mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 16:30:34 +01:00
refactor: move post uploads to post hash (#13533)
* refactor: move post uploads to post hash * test: add uploads to api definition * refactor: move thumbs to topic hash * chore: up composer * refactor: dont use old zset
This commit is contained in:
@@ -34,6 +34,7 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
humanReadableNumber,
|
||||
formattedNumber,
|
||||
txEscape,
|
||||
uploadBasename,
|
||||
generatePlaceholderWave,
|
||||
register,
|
||||
__escape: identity,
|
||||
@@ -379,6 +380,12 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
return String(text).replace(/%/g, '%').replace(/,/g, ',');
|
||||
}
|
||||
|
||||
function uploadBasename(str, sep = '/') {
|
||||
const hasTimestampPrefix = /^\d+-/;
|
||||
const name = str.substr(str.lastIndexOf(sep) + 1);
|
||||
return hasTimestampPrefix.test(name) ? name.slice(14) : name;
|
||||
}
|
||||
|
||||
function generatePlaceholderWave(items) {
|
||||
const html = items.map((i) => {
|
||||
if (i === 'divider') {
|
||||
|
||||
Reference in New Issue
Block a user