mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
ESlint comma-dangle
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
node_modules/
|
||||
public/src/nodebb.min.js
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
.project
|
||||
@@ -10,8 +9,6 @@ logs/
|
||||
/public/uploads
|
||||
/public/sounds
|
||||
/public/vendor
|
||||
/public/nodebb.min.js
|
||||
/public/acp.min.js
|
||||
/public/src/modules/string.js
|
||||
.idea/
|
||||
.vscode/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
"rules": {
|
||||
"handle-callback-err": [ "error","^(e$|(e|(.*(_e|E)))rr)" ],
|
||||
"linebreak-style": "off",
|
||||
// "linebreak-style": "off",
|
||||
"import/no-unresolved": "off",
|
||||
"import/no-extraneous-dependencies": "off",
|
||||
"one-var": "off",
|
||||
@@ -72,7 +72,7 @@
|
||||
"no-param-reassign": "off",
|
||||
"consistent-return": "off",
|
||||
"strict": "off",
|
||||
"comma-dangle": "off",
|
||||
// "comma-dangle": "off",
|
||||
"no-multi-spaces": "off",
|
||||
"quotes": "off",
|
||||
"keyword-spacing": "off",
|
||||
@@ -100,7 +100,6 @@
|
||||
"dot-notation": "off",
|
||||
"func-call-spacing": "off",
|
||||
"newline-per-chained-call": "off",
|
||||
"newline-per-chained-call": "off",
|
||||
"array-bracket-spacing": "off",
|
||||
"object-property-newline": "off",
|
||||
"no-continue": "off",
|
||||
|
||||
32
Gruntfile.js
32
Gruntfile.js
@@ -70,17 +70,17 @@ module.exports = function (grunt) {
|
||||
'public/*.less',
|
||||
'node_modules/nodebb-*/*.less', 'node_modules/nodebb-*/**/*.less',
|
||||
'!node_modules/nodebb-*/node_modules/**',
|
||||
'!node_modules/nodebb-*/.git/**'
|
||||
'!node_modules/nodebb-*/.git/**',
|
||||
],
|
||||
options: {
|
||||
interval: 1000
|
||||
}
|
||||
interval: 1000,
|
||||
},
|
||||
},
|
||||
lessUpdated_Admin: {
|
||||
files: ['public/**/*.less'],
|
||||
options: {
|
||||
interval: 1000
|
||||
}
|
||||
interval: 1000,
|
||||
},
|
||||
},
|
||||
clientUpdated: {
|
||||
files: [
|
||||
@@ -88,28 +88,28 @@ module.exports = function (grunt) {
|
||||
'node_modules/nodebb-*/*.js', 'node_modules/nodebb-*/**/*.js',
|
||||
'!node_modules/nodebb-*/node_modules/**',
|
||||
'node_modules/templates.js/lib/templates.js',
|
||||
'!node_modules/nodebb-*/.git/**'
|
||||
'!node_modules/nodebb-*/.git/**',
|
||||
],
|
||||
options: {
|
||||
interval: 1000
|
||||
}
|
||||
interval: 1000,
|
||||
},
|
||||
},
|
||||
serverUpdated: {
|
||||
files: ['*.js', 'install/*.js', 'src/**/*.js'],
|
||||
options: {
|
||||
interval: 1000
|
||||
}
|
||||
interval: 1000,
|
||||
},
|
||||
},
|
||||
templatesUpdated: {
|
||||
files: [
|
||||
'src/views/**/*.tpl',
|
||||
'node_modules/nodebb-*/*.tpl', 'node_modules/nodebb-*/**/*.tpl',
|
||||
'!node_modules/nodebb-*/node_modules/**',
|
||||
'!node_modules/nodebb-*/.git/**'
|
||||
'!node_modules/nodebb-*/.git/**',
|
||||
],
|
||||
options: {
|
||||
interval: 1000
|
||||
}
|
||||
interval: 1000,
|
||||
},
|
||||
},
|
||||
langUpdated: {
|
||||
files: [
|
||||
@@ -123,10 +123,10 @@ module.exports = function (grunt) {
|
||||
'!node_modules/nodebb-*/theme.json',
|
||||
],
|
||||
options: {
|
||||
interval: 1000
|
||||
}
|
||||
interval: 1000,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
|
||||
12
app.js
12
app.js
@@ -41,7 +41,7 @@ winston.add(winston.transports.Console, {
|
||||
},
|
||||
level: nconf.get('log-level') || (global.env === 'production' ? 'info' : 'verbose'),
|
||||
json: (!!nconf.get('json-logging')),
|
||||
stringify: (!!nconf.get('json-logging'))
|
||||
stringify: (!!nconf.get('json-logging')),
|
||||
});
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ if (nconf.get('setup') || nconf.get('install')) {
|
||||
} else if (nconf.get('reset')) {
|
||||
async.waterfall([
|
||||
async.apply(require('./src/reset').reset),
|
||||
async.apply(require('./src/meta/build').buildAll)
|
||||
async.apply(require('./src/meta/build').buildAll),
|
||||
], function (err) {
|
||||
process.exit(err ? 1 : 0);
|
||||
});
|
||||
@@ -93,7 +93,7 @@ function loadConfig(callback) {
|
||||
winston.verbose('* using configuration stored in: %s', configFile);
|
||||
|
||||
nconf.file({
|
||||
file: configFile
|
||||
file: configFile,
|
||||
});
|
||||
|
||||
nconf.defaults({
|
||||
@@ -101,7 +101,7 @@ function loadConfig(callback) {
|
||||
themes_path: path.join(__dirname, 'node_modules'),
|
||||
upload_path: 'public/uploads',
|
||||
views_dir: path.join(__dirname, 'build/public/templates'),
|
||||
version: pkg.version
|
||||
version: pkg.version,
|
||||
});
|
||||
|
||||
if (!nconf.get('isCluster')) {
|
||||
@@ -149,7 +149,7 @@ function setup() {
|
||||
async.series([
|
||||
async.apply(install.setup),
|
||||
async.apply(loadConfig),
|
||||
async.apply(build.buildAll)
|
||||
async.apply(build.buildAll),
|
||||
], function (err, data) {
|
||||
// Disregard build step data
|
||||
data = data[0];
|
||||
@@ -194,7 +194,7 @@ function upgrade() {
|
||||
async.apply(db.init),
|
||||
async.apply(meta.configs.init),
|
||||
async.apply(upgrade.upgrade),
|
||||
async.apply(build.buildAll)
|
||||
async.apply(build.buildAll),
|
||||
], function (err) {
|
||||
if (err) {
|
||||
winston.error(err.stack);
|
||||
|
||||
@@ -20,7 +20,7 @@ function hashPassword(password, rounds) {
|
||||
},
|
||||
function (salt, next) {
|
||||
bcrypt.hash(password, salt, next);
|
||||
}
|
||||
},
|
||||
], done);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ var winston = require('winston');
|
||||
|
||||
var questions = {
|
||||
redis: require('../src/database/redis').questions,
|
||||
mongo: require('../src/database/mongo').questions
|
||||
mongo: require('../src/database/mongo').questions,
|
||||
};
|
||||
|
||||
module.exports = function (config, callback) {
|
||||
@@ -18,7 +18,7 @@ module.exports = function (config, callback) {
|
||||
},
|
||||
function (databaseConfig, next) {
|
||||
saveDatabaseConfig(config, databaseConfig, next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -55,7 +55,7 @@ function saveDatabaseConfig(config, databaseConfig, callback) {
|
||||
host: databaseConfig['redis:host'],
|
||||
port: databaseConfig['redis:port'],
|
||||
password: databaseConfig['redis:password'],
|
||||
database: databaseConfig['redis:database']
|
||||
database: databaseConfig['redis:database'],
|
||||
};
|
||||
|
||||
if (config.redis.host.slice(0, 1) === '/') {
|
||||
@@ -67,7 +67,7 @@ function saveDatabaseConfig(config, databaseConfig, callback) {
|
||||
port: databaseConfig['mongo:port'],
|
||||
username: databaseConfig['mongo:username'],
|
||||
password: databaseConfig['mongo:password'],
|
||||
database: databaseConfig['mongo:database']
|
||||
database: databaseConfig['mongo:database'],
|
||||
};
|
||||
} else {
|
||||
return callback(new Error('unknown database : ' + config.database));
|
||||
|
||||
@@ -19,7 +19,7 @@ winston.add(winston.transports.File, {
|
||||
var date = new Date();
|
||||
return date.getDate() + '/' + (date.getMonth() + 1) + ' ' + date.toTimeString().substr(0,5) + ' [' + global.process.pid + ']';
|
||||
},
|
||||
level: 'verbose'
|
||||
level: 'verbose',
|
||||
});
|
||||
|
||||
var web = {};
|
||||
@@ -27,7 +27,7 @@ var scripts = [
|
||||
'public/vendor/xregexp/xregexp.js',
|
||||
'public/vendor/xregexp/unicode/unicode-base.js',
|
||||
'public/src/utils.js',
|
||||
'public/src/installer/install.js'
|
||||
'public/src/installer/install.js',
|
||||
];
|
||||
|
||||
web.install = function (port) {
|
||||
@@ -39,7 +39,7 @@ web.install = function (port) {
|
||||
app.set('view engine', 'tpl');
|
||||
app.set('views', path.join(__dirname, '../src/views'));
|
||||
app.use(bodyParser.urlencoded({
|
||||
extended: true
|
||||
extended: true,
|
||||
}));
|
||||
|
||||
async.parallel([compileLess, compileJS], function () {
|
||||
@@ -66,7 +66,7 @@ function welcome(req, res) {
|
||||
var databases = dbs.map(function (el) {
|
||||
return {
|
||||
name: el,
|
||||
questions: require('../src/database/' + el).questions
|
||||
questions: require('../src/database/' + el).questions,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -78,7 +78,7 @@ function welcome(req, res) {
|
||||
error: res.locals.error ? true : false,
|
||||
success: res.locals.success ? true : false,
|
||||
values: req.body,
|
||||
minimumPasswordLength: defaults.minimumPasswordLength
|
||||
minimumPasswordLength: defaults.minimumPasswordLength,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ function install(req, res) {
|
||||
}
|
||||
|
||||
var child = require('child_process').fork('app', ['--setup'], {
|
||||
env: process.env
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
child.on('close', function (data) {
|
||||
@@ -110,7 +110,7 @@ function launch(req, res) {
|
||||
|
||||
var child = require('child_process').spawn('node', ['loader.js'], {
|
||||
detached: true,
|
||||
stdio: ['ignore', 'ignore', 'ignore']
|
||||
stdio: ['ignore', 'ignore', 'ignore'],
|
||||
});
|
||||
|
||||
process.stdout.write('\nStarting NodeBB\n');
|
||||
@@ -120,7 +120,7 @@ function launch(req, res) {
|
||||
|
||||
async.parallel([
|
||||
async.apply(fs.unlink(path.join(__dirname, '../public/installer.css'))),
|
||||
async.apply(fs.unlink(path.join(__dirname, '../public/installer.min.js')))
|
||||
async.apply(fs.unlink(path.join(__dirname, '../public/installer.min.js'))),
|
||||
], function (err) {
|
||||
if (err) {
|
||||
winston.warn('Unable to remove installer files');
|
||||
|
||||
12
loader.js
12
loader.js
@@ -12,7 +12,7 @@ var nconf = require('nconf'),
|
||||
pkg = require('./package.json');
|
||||
|
||||
nconf.argv().env().file({
|
||||
file: path.join(__dirname, '/config.json')
|
||||
file: path.join(__dirname, '/config.json'),
|
||||
});
|
||||
|
||||
var pidFilePath = __dirname + '/pidfile',
|
||||
@@ -22,7 +22,7 @@ var pidFilePath = __dirname + '/pidfile',
|
||||
workers = [],
|
||||
|
||||
Loader = {
|
||||
timesStarted: 0
|
||||
timesStarted: 0,
|
||||
};
|
||||
|
||||
Loader.init = function (callback) {
|
||||
@@ -118,7 +118,7 @@ function forkWorker(index, isPrimary) {
|
||||
|
||||
var worker = fork('app.js', args, {
|
||||
silent: silent,
|
||||
env: process.env
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
worker.index = index;
|
||||
@@ -175,7 +175,7 @@ Loader.restart = function () {
|
||||
Loader.reload = function () {
|
||||
workers.forEach(function (worker) {
|
||||
worker.send({
|
||||
action: 'reload'
|
||||
action: 'reload',
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -222,7 +222,7 @@ fs.open(path.join(__dirname, 'config.json'), 'r', function (err) {
|
||||
|
||||
require('daemon')({
|
||||
stdout: process.stdout,
|
||||
stderr: process.stderr
|
||||
stderr: process.stderr,
|
||||
});
|
||||
|
||||
fs.writeFile(__dirname + '/pidfile', process.pid);
|
||||
@@ -231,7 +231,7 @@ fs.open(path.join(__dirname, 'config.json'), 'r', function (err) {
|
||||
async.series([
|
||||
Loader.init,
|
||||
Loader.displayStartupMessages,
|
||||
Loader.start
|
||||
Loader.start,
|
||||
], function (err) {
|
||||
if (err) {
|
||||
console.log('[loader] Error during startup: ' + err.message);
|
||||
|
||||
10
minifier.js
10
minifier.js
@@ -6,7 +6,7 @@ var fs = require('fs');
|
||||
var file = require('./src/file');
|
||||
|
||||
var Minifier = {
|
||||
js: {}
|
||||
js: {},
|
||||
};
|
||||
|
||||
/* Javascript */
|
||||
@@ -39,7 +39,7 @@ process.on('message', function (payload) {
|
||||
process.send({
|
||||
type: 'end',
|
||||
// sourceMap: sourceMap,
|
||||
minified: minified
|
||||
minified: minified,
|
||||
});
|
||||
});
|
||||
break;
|
||||
@@ -52,14 +52,14 @@ function minifyScripts(scripts, callback) {
|
||||
try {
|
||||
var minified = uglifyjs.minify(scripts, {
|
||||
// outSourceMap: "nodebb.min.js.map",
|
||||
compress: false
|
||||
compress: false,
|
||||
});
|
||||
|
||||
callback(minified.code/*, minified.map*/);
|
||||
} catch(err) {
|
||||
process.send({
|
||||
type: 'error',
|
||||
message: err.message
|
||||
message: err.message,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ function concatenateScripts(scripts, callback) {
|
||||
if (err) {
|
||||
process.send({
|
||||
type: 'error',
|
||||
message: err.message
|
||||
message: err.message,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
message: '[[login:logged-out-due-to-inactivity]]',
|
||||
callback: function () {
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
});
|
||||
}, 3600000);
|
||||
}
|
||||
@@ -165,7 +165,7 @@
|
||||
var bar = $.snackbar({
|
||||
content: html,
|
||||
timeout: params.timeout || 3000,
|
||||
htmlAllowed: true
|
||||
htmlAllowed: true,
|
||||
});
|
||||
|
||||
if (params.clickfn) {
|
||||
@@ -182,7 +182,7 @@
|
||||
'panel': document.getElementById('panel'),
|
||||
'menu': document.getElementById('menu'),
|
||||
'padding': 256,
|
||||
'tolerance': 70
|
||||
'tolerance': 70,
|
||||
});
|
||||
|
||||
if (env === 'md' || env === 'lg') {
|
||||
@@ -205,12 +205,12 @@
|
||||
if (env === 'md' || env === 'lg') {
|
||||
slideout.disableTouch();
|
||||
$('#header').css({
|
||||
'position': 'relative'
|
||||
'position': 'relative',
|
||||
});
|
||||
} else {
|
||||
slideout.enableTouch();
|
||||
$('#header').css({
|
||||
'position': 'fixed'
|
||||
'position': 'fixed',
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -218,7 +218,7 @@
|
||||
function onOpeningMenu() {
|
||||
$('#header').css({
|
||||
'top': $('#panel').position().top * -1 + 'px',
|
||||
'position': 'absolute'
|
||||
'position': 'absolute',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
slideout.on('close', function () {
|
||||
$('#header').css({
|
||||
'top': '0px',
|
||||
'position': 'fixed'
|
||||
'position': 'fixed',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,9 +48,9 @@ define('admin/advanced/errors', ['Chart', 'translator'], function (Chart, transl
|
||||
pointHoverBackgroundColor: "#fff",
|
||||
pointBorderColor: "#fff",
|
||||
pointHoverBorderColor: "rgba(186,139,175,1)",
|
||||
data: ajaxify.data.analytics['not-found']
|
||||
}
|
||||
]
|
||||
data: ajaxify.data.analytics['not-found'],
|
||||
},
|
||||
],
|
||||
},
|
||||
'toobusy': {
|
||||
labels: dailyLabels,
|
||||
@@ -63,10 +63,10 @@ define('admin/advanced/errors', ['Chart', 'translator'], function (Chart, transl
|
||||
pointHoverBackgroundColor: "#fff",
|
||||
pointBorderColor: "#fff",
|
||||
pointHoverBorderColor: "rgba(151,187,205,1)",
|
||||
data: ajaxify.data.analytics['toobusy']
|
||||
}
|
||||
]
|
||||
}
|
||||
data: ajaxify.data.analytics['toobusy'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
notFoundCanvas.width = $(notFoundCanvas).parent().width();
|
||||
@@ -78,16 +78,16 @@ define('admin/advanced/errors', ['Chart', 'translator'], function (Chart, transl
|
||||
options: {
|
||||
responsive: true,
|
||||
legend: {
|
||||
display: false
|
||||
display: false,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
beginAtZero: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
new Chart(tooBusyCanvas.getContext('2d'), {
|
||||
@@ -96,16 +96,16 @@ define('admin/advanced/errors', ['Chart', 'translator'], function (Chart, transl
|
||||
options: {
|
||||
responsive: true,
|
||||
legend: {
|
||||
display: false
|
||||
display: false,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
beginAtZero: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ define('admin/appearance/skins', ['translator'], function (translator) {
|
||||
// Populate skins from Bootswatch API
|
||||
$.ajax({
|
||||
method: 'get',
|
||||
url: 'https://bootswatch.com/api/3.json'
|
||||
url: 'https://bootswatch.com/api/3.json',
|
||||
}).done(Skins.render);
|
||||
|
||||
$('#skins').on('click', function (e) {
|
||||
@@ -30,7 +30,7 @@ define('admin/appearance/skins', ['translator'], function (translator) {
|
||||
socket.emit('admin.themes.set', {
|
||||
type: themeType,
|
||||
id: themeId,
|
||||
src: cssSrc
|
||||
src: cssSrc,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -42,7 +42,7 @@ define('admin/appearance/skins', ['translator'], function (translator) {
|
||||
type: 'info',
|
||||
title: '[[admin/appearance/skins:skin-updated]]',
|
||||
message: themeId ? ('[[admin/appearance/skins:applied-success, ' + themeId + ']]') : '[[admin/appearance/skins:revert-success]]',
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -62,10 +62,10 @@ define('admin/appearance/skins', ['translator'], function (translator) {
|
||||
screenshot_url: theme.thumbnail,
|
||||
url: theme.preview,
|
||||
css: theme.cssCdn,
|
||||
skin: true
|
||||
skin: true,
|
||||
};
|
||||
}),
|
||||
showRevert: true
|
||||
showRevert: true,
|
||||
}, function (html) {
|
||||
translator.translate(html, function (html) {
|
||||
themeContainer.html(html);
|
||||
|
||||
@@ -18,7 +18,7 @@ define('admin/appearance/themes', ['translator'], function (translator) {
|
||||
socket.emit('admin.themes.set', {
|
||||
type: themeType,
|
||||
id: themeId,
|
||||
src: cssSrc
|
||||
src: cssSrc,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -34,7 +34,7 @@ define('admin/appearance/themes', ['translator'], function (translator) {
|
||||
timeout: 5000,
|
||||
clickfn: function () {
|
||||
socket.emit('admin.restart');
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -45,7 +45,7 @@ define('admin/appearance/themes', ['translator'], function (translator) {
|
||||
if (confirm) {
|
||||
socket.emit('admin.themes.set', {
|
||||
type: 'local',
|
||||
id: 'nodebb-theme-persona'
|
||||
id: 'nodebb-theme-persona',
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -56,7 +56,7 @@ define('admin/appearance/themes', ['translator'], function (translator) {
|
||||
type: 'success',
|
||||
title: '[[admin/appearance/themes:theme-changed]]',
|
||||
message: '[[admin/appearance/themes:revert-success]]',
|
||||
timeout: 3500
|
||||
timeout: 3500,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -75,7 +75,7 @@ define('admin/appearance/themes', ['translator'], function (translator) {
|
||||
return;
|
||||
} else {
|
||||
templates.parse('admin/partials/theme_list', {
|
||||
themes: themes
|
||||
themes: themes,
|
||||
}, function (html) {
|
||||
translator.translate(html, function (html) {
|
||||
instListEl.html(html);
|
||||
|
||||
@@ -44,7 +44,7 @@ define('admin/extend/plugins', ['jqueryui', 'translator'], function (jqueryui, t
|
||||
require(['admin/modules/instance'], function (instance) {
|
||||
instance.restart();
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -170,7 +170,7 @@ define('admin/extend/plugins', ['jqueryui', 'translator'], function (jqueryui, t
|
||||
btn.attr('disabled', true).find('i').attr('class', 'fa fa-refresh fa-spin');
|
||||
socket.emit('admin.plugins.upgrade', {
|
||||
id: pluginID,
|
||||
version: version
|
||||
version: version,
|
||||
}, function (err, isActive) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -190,7 +190,7 @@ define('admin/extend/plugins', ['jqueryui', 'translator'], function (jqueryui, t
|
||||
require(['admin/modules/instance'], function (instance) {
|
||||
instance.reload();
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -203,7 +203,7 @@ define('admin/extend/plugins', ['jqueryui', 'translator'], function (jqueryui, t
|
||||
|
||||
socket.emit('admin.plugins.toggleInstall', {
|
||||
id: pluginID,
|
||||
version: version
|
||||
version: version,
|
||||
}, function (err, pluginData) {
|
||||
if (err) {
|
||||
btn.removeAttr('disabled');
|
||||
@@ -217,7 +217,7 @@ define('admin/extend/plugins', ['jqueryui', 'translator'], function (jqueryui, t
|
||||
title: '[[admin/extend/plugins:alert.' + (pluginData.installed ? 'installed' : 'uninstalled') + ']]',
|
||||
message: '[[admin/extend/plugins:alert.' + (pluginData.installed ? 'install-success' : 'uninstall-success') + ']]',
|
||||
type: 'info',
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
@@ -232,9 +232,9 @@ define('admin/extend/plugins', ['jqueryui', 'translator'], function (jqueryui, t
|
||||
type: 'GET',
|
||||
data: {
|
||||
package: pluginId,
|
||||
version: nbbVersion[0]
|
||||
version: nbbVersion[0],
|
||||
},
|
||||
dataType: 'json'
|
||||
dataType: 'json',
|
||||
}).done(function (payload) {
|
||||
callback(undefined, payload);
|
||||
}).fail(callback);
|
||||
|
||||
@@ -133,7 +133,7 @@ define('admin/extend/rewards', ['translator'], function (translator) {
|
||||
value: '',
|
||||
claimable: 1,
|
||||
rid: null,
|
||||
id: null
|
||||
id: null,
|
||||
}],
|
||||
conditions: conditions,
|
||||
conditionals: conditionals,
|
||||
|
||||
@@ -35,7 +35,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) {
|
||||
return $(e.target).parents('.widget-panel').clone();
|
||||
},
|
||||
distance: 10,
|
||||
connectToSortable: ".widget-area"
|
||||
connectToSortable: ".widget-area",
|
||||
});
|
||||
|
||||
$('#widgets .available-containers .containers > [data-container-html]')
|
||||
@@ -46,7 +46,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) {
|
||||
|
||||
return target.clone().addClass('block').width(target.width()).css('opacity', '0.5');
|
||||
},
|
||||
distance: 10
|
||||
distance: 10,
|
||||
})
|
||||
.each(function () {
|
||||
$(this).attr('data-container-html', $(this).attr('data-container-html').replace(/\\\{([\s\S]*?)\\\}/g, '{$1}'));
|
||||
@@ -57,7 +57,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) {
|
||||
createDatePicker(ui.item);
|
||||
appendToggle(ui.item);
|
||||
},
|
||||
connectWith: "div"
|
||||
connectWith: "div",
|
||||
}).on('click', '.delete-widget', function () {
|
||||
var panel = $(this).parents('.widget-panel');
|
||||
|
||||
@@ -106,14 +106,14 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) {
|
||||
|
||||
widgets.push({
|
||||
widget: $(this).attr('data-widget'),
|
||||
data: widgetData
|
||||
data: widgetData,
|
||||
});
|
||||
});
|
||||
|
||||
socket.emit('admin.widgets.set', {
|
||||
template: template,
|
||||
location: location,
|
||||
widgets: widgets
|
||||
widgets: widgets,
|
||||
}, function (err) {
|
||||
total--;
|
||||
|
||||
@@ -127,7 +127,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) {
|
||||
type: 'success',
|
||||
title: '[[admin/extend/widgets:alert.updated]]',
|
||||
message: '[[admin/extend/widgets:alert.update-success]]',
|
||||
timeout: 2500
|
||||
timeout: 2500,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) {
|
||||
.addClass(btn.attr('data-class'));
|
||||
|
||||
container.attr('data-container-html', container.attr('data-container-html')
|
||||
.replace(/class="[a-zA-Z0-9-\s]+"/, 'class="' + container[0].className.replace(' pointer ui-draggable', '') + '"')
|
||||
.replace(/class="[a-zA-Z0-9-\s]+"/, 'class="' + container[0].className.replace(' pointer ui-draggable', '') + '"'),
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -160,7 +160,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) {
|
||||
el.find('.date-selector').datepicker({
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
yearRange: currentYear + ':' + (currentYear + 100)
|
||||
yearRange: currentYear + ':' + (currentYear + 100),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) {
|
||||
el.find('.panel-body .container-html').val(ui.draggable.attr('data-container-html'));
|
||||
el.find('.panel-body').removeClass('hidden');
|
||||
},
|
||||
hoverClass: "panel-info"
|
||||
hoverClass: "panel-info",
|
||||
})
|
||||
.children('.panel-heading')
|
||||
.append('<div class="pull-right pointer"><span class="delete-widget"><i class="fa fa-times-circle"></i></span></div><div class="pull-left pointer"><span class="toggle-widget"><i class="fa fa-chevron-circle-down"></i></span> </div>')
|
||||
|
||||
@@ -5,23 +5,23 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
var Admin = {};
|
||||
var intervals = {
|
||||
rooms: false,
|
||||
graphs: false
|
||||
graphs: false,
|
||||
};
|
||||
var isMobile = false;
|
||||
var isPrerelease = /^v?\d+\.\d+\.\d+-.+$/;
|
||||
var graphData = {
|
||||
rooms: {},
|
||||
traffic: {}
|
||||
traffic: {},
|
||||
};
|
||||
var currentGraph = {
|
||||
units: 'hours',
|
||||
until: undefined
|
||||
until: undefined,
|
||||
};
|
||||
|
||||
var DEFAULTS = {
|
||||
roomInterval: 10000,
|
||||
graphInterval: 15000,
|
||||
realtimeInterval: 1500
|
||||
realtimeInterval: 1500,
|
||||
};
|
||||
|
||||
$(window).on('action:ajaxify.start', function (ev, data) {
|
||||
@@ -123,7 +123,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
traffic: null,
|
||||
registered: null,
|
||||
presence: null,
|
||||
topics: null
|
||||
topics: null,
|
||||
};
|
||||
|
||||
var topicColors = ["#bf616a","#5B90BF","#d08770","#ebcb8b","#a3be8c","#96b5b4","#8fa1b3","#b48ead","#ab7967","#46BFBD"];
|
||||
@@ -196,7 +196,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
pointHoverBackgroundColor: "#fff",
|
||||
pointBorderColor: "#fff",
|
||||
pointHoverBorderColor: "rgba(220,220,220,1)",
|
||||
data: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
data: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
},
|
||||
{
|
||||
label: translations[1],
|
||||
@@ -206,9 +206,9 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
pointHoverBackgroundColor: "#fff",
|
||||
pointBorderColor: "#fff",
|
||||
pointHoverBorderColor: "rgba(151,187,205,1)",
|
||||
data: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
}
|
||||
]
|
||||
data: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
trafficCanvas.width = $(trafficCanvas).parent().width();
|
||||
@@ -218,16 +218,16 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
options: {
|
||||
responsive: true,
|
||||
legend: {
|
||||
display: false
|
||||
display: false,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
beginAtZero: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
graphs.registered = new Chart(registeredCtx, {
|
||||
@@ -237,15 +237,15 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
datasets: [{
|
||||
data: [1, 1],
|
||||
backgroundColor: ["#F7464A", "#46BFBD"],
|
||||
hoverBackgroundColor: ["#FF5A5E", "#5AD3D1"]
|
||||
}]
|
||||
hoverBackgroundColor: ["#FF5A5E", "#5AD3D1"],
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
legend: {
|
||||
display: false
|
||||
}
|
||||
}
|
||||
display: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
graphs.presence = new Chart(presenceCtx, {
|
||||
@@ -255,15 +255,15 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
datasets: [{
|
||||
data: [1, 1, 1, 1, 1],
|
||||
backgroundColor: ["#F7464A", "#46BFBD", "#FDB45C", "#949FB1", "#9FB194"],
|
||||
hoverBackgroundColor: ["#FF5A5E", "#5AD3D1", "#FFC870", "#A8B3C5", "#A8B3C5"]
|
||||
}]
|
||||
hoverBackgroundColor: ["#FF5A5E", "#5AD3D1", "#FFC870", "#A8B3C5", "#A8B3C5"],
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
legend: {
|
||||
display: false
|
||||
}
|
||||
}
|
||||
display: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
graphs.topics = new Chart(topicsCtx, {
|
||||
@@ -273,15 +273,15 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
datasets: [{
|
||||
data: [],
|
||||
backgroundColor: [],
|
||||
hoverBackgroundColor: []
|
||||
}]
|
||||
hoverBackgroundColor: [],
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
legend: {
|
||||
display: false
|
||||
}
|
||||
}
|
||||
display: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
updateTrafficGraph();
|
||||
@@ -322,7 +322,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
socket.emit('admin.analytics.get', {
|
||||
graph: 'traffic',
|
||||
units: units || 'hours',
|
||||
until: until
|
||||
until: until,
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -376,7 +376,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
if (!Object.keys(topics).length) {
|
||||
topics = {"0": {
|
||||
title: "No users browsing",
|
||||
value: 1
|
||||
value: 1,
|
||||
}};
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ define('admin/general/navigation', ['translator', 'iconSelect', 'jqueryui'], fun
|
||||
connectToSortable: '#active-navigation',
|
||||
helper: 'clone',
|
||||
distance: 10,
|
||||
stop: drop
|
||||
stop: drop,
|
||||
});
|
||||
});
|
||||
|
||||
$('#active-navigation').sortable().droppable({
|
||||
accept: $('#available li .drag-item')
|
||||
accept: $('#available li .drag-item'),
|
||||
});
|
||||
|
||||
$('#enabled').on('click', '.iconPicker', function () {
|
||||
|
||||
@@ -21,7 +21,7 @@ define('admin/general/sounds', ['sounds', 'settings'], function (Sounds, Setting
|
||||
saveEl.on('click', function () {
|
||||
Settings.save('sounds', $('.sounds form'), function () {
|
||||
socket.emit('admin.fireEvent', {
|
||||
name: 'event:sounds.reloadMapping'
|
||||
name: 'event:sounds.reloadMapping',
|
||||
});
|
||||
app.alertSuccess('[[admin/general/sounds:saved]]');
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
|
||||
}
|
||||
|
||||
templates.parse('admin/partials/categories/create', {
|
||||
categories: categories
|
||||
categories: categories,
|
||||
}, function (html) {
|
||||
function submit() {
|
||||
var formData = modal.find('form').serializeObject();
|
||||
@@ -57,9 +57,9 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
|
||||
save: {
|
||||
label: '[[global:save]]',
|
||||
className: 'btn-primary',
|
||||
callback: submit
|
||||
}
|
||||
}
|
||||
callback: submit,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
modal.find('form').on('submit', submit);
|
||||
@@ -78,7 +78,7 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
|
||||
title: '[[admin/manage/categories:alert.created]]',
|
||||
message: '[[admin/manage/categories:alert.create-success]]',
|
||||
type: 'success',
|
||||
timeout: 2000
|
||||
timeout: 2000,
|
||||
});
|
||||
|
||||
ajaxify.go('admin/manage/categories/' + data.cid);
|
||||
@@ -106,7 +106,7 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
|
||||
|
||||
cids.forEach(function (cid) {
|
||||
payload[cid] = {
|
||||
disabled: disabled ? 1 : 0
|
||||
disabled: disabled ? 1 : 0,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -132,7 +132,7 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
|
||||
|
||||
for(i; i < len; ++i) {
|
||||
modified[list[i]] = {
|
||||
order: (i + 1)
|
||||
order: (i + 1),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
|
||||
function continueRender() {
|
||||
templates.parse('admin/partials/categories/category-rows', {
|
||||
cid: parentId,
|
||||
categories: categories
|
||||
categories: categories,
|
||||
}, function (html) {
|
||||
translator.translate(html, function (html) {
|
||||
container.append(html);
|
||||
@@ -194,7 +194,7 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
|
||||
dataIdAttr: 'data-cid',
|
||||
ghostClass: "placeholder",
|
||||
onAdd: itemDidAdd,
|
||||
onEnd: itemDragDidEnd
|
||||
onEnd: itemDragDidEnd,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -32,9 +32,9 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
|
||||
pointHoverBackgroundColor: "#fff",
|
||||
pointBorderColor: "#fff",
|
||||
pointHoverBorderColor: "rgba(186,139,175,1)",
|
||||
data: ajaxify.data.analytics['pageviews:hourly']
|
||||
}
|
||||
]
|
||||
data: ajaxify.data.analytics['pageviews:hourly'],
|
||||
},
|
||||
],
|
||||
},
|
||||
'pageviews:daily': {
|
||||
labels: dailyLabels,
|
||||
@@ -47,9 +47,9 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
|
||||
pointHoverBackgroundColor: "#fff",
|
||||
pointBorderColor: "#fff",
|
||||
pointHoverBorderColor: "rgba(151,187,205,1)",
|
||||
data: ajaxify.data.analytics['pageviews:daily']
|
||||
}
|
||||
]
|
||||
data: ajaxify.data.analytics['pageviews:daily'],
|
||||
},
|
||||
],
|
||||
},
|
||||
'topics:daily': {
|
||||
labels: dailyLabels.slice(-7),
|
||||
@@ -62,9 +62,9 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
|
||||
pointHoverBackgroundColor: "#fff",
|
||||
pointBorderColor: "#fff",
|
||||
pointHoverBorderColor: "rgba(171,70,66,1)",
|
||||
data: ajaxify.data.analytics['topics:daily']
|
||||
}
|
||||
]
|
||||
data: ajaxify.data.analytics['topics:daily'],
|
||||
},
|
||||
],
|
||||
},
|
||||
'posts:daily': {
|
||||
labels: dailyLabels.slice(-7),
|
||||
@@ -77,10 +77,10 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
|
||||
pointHoverBackgroundColor: "#fff",
|
||||
pointBorderColor: "#fff",
|
||||
pointHoverBorderColor: "rgba(161,181,108,1)",
|
||||
data: ajaxify.data.analytics['posts:daily']
|
||||
}
|
||||
]
|
||||
}
|
||||
data: ajaxify.data.analytics['posts:daily'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
hourlyCanvas.width = $(hourlyCanvas).parent().width();
|
||||
@@ -95,16 +95,16 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
|
||||
responsive: true,
|
||||
animation: false,
|
||||
legend: {
|
||||
display: false
|
||||
display: false,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
beginAtZero: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
new Chart(dailyCanvas.getContext('2d'), {
|
||||
@@ -114,16 +114,16 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
|
||||
responsive: true,
|
||||
animation: false,
|
||||
legend: {
|
||||
display: false
|
||||
display: false,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
beginAtZero: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
new Chart(topicsCanvas.getContext('2d'), {
|
||||
@@ -133,16 +133,16 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
|
||||
responsive: true,
|
||||
animation: false,
|
||||
legend: {
|
||||
display: false
|
||||
display: false,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
beginAtZero: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
new Chart(postsCanvas.getContext('2d'), {
|
||||
@@ -152,16 +152,16 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
|
||||
responsive: true,
|
||||
animation: false,
|
||||
legend: {
|
||||
display: false
|
||||
display: false,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
beginAtZero: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ define('admin/manage/category', [
|
||||
'iconSelect',
|
||||
'admin/modules/colorpicker',
|
||||
'autocomplete',
|
||||
'translator'
|
||||
'translator',
|
||||
], function (uploader, iconSelect, colorpicker, autocomplete, translator) {
|
||||
var Category = {};
|
||||
var modified_categories = {};
|
||||
@@ -41,10 +41,10 @@ define('admin/manage/category', [
|
||||
title: '[[admin/manage/categories:alert.updated]]',
|
||||
message: translator.compile(
|
||||
'admin/manage/categories:alert.updated-success',
|
||||
results.join(', ')
|
||||
results.join(', '),
|
||||
),
|
||||
type: 'success',
|
||||
timeout: 2000
|
||||
timeout: 2000,
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -103,7 +103,7 @@ define('admin/manage/category', [
|
||||
title: 'Updated Categories',
|
||||
message: 'Category IDs ' + result.join(', ') + ' was successfully updated.',
|
||||
type: 'success',
|
||||
timeout: 2000
|
||||
timeout: 2000,
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -117,7 +117,7 @@ define('admin/manage/category', [
|
||||
|
||||
bootbox.confirm(translator.compile(
|
||||
'admin/manage/categories:alert.confirm-purge',
|
||||
$('form.category').find('input[data-name="name"]').val()
|
||||
$('form.category').find('input[data-name="name"]').val(),
|
||||
), function (confirm) {
|
||||
if (!confirm) {
|
||||
return;
|
||||
@@ -152,7 +152,7 @@ define('admin/manage/category', [
|
||||
uploader.show({
|
||||
title: '[[admin/manage/categories:alert.upload-image]]',
|
||||
route: config.relative_path + '/api/admin/category/uploadpicture',
|
||||
params: {cid: cid}
|
||||
params: {cid: cid},
|
||||
}, function (imageUrlOnServer) {
|
||||
$('#category-image').val(imageUrlOnServer);
|
||||
var previewBox = inputEl.parent().parent().siblings('.category-preview');
|
||||
@@ -186,7 +186,7 @@ define('admin/manage/category', [
|
||||
$('button[data-action="removeParent"]').on('click', function () {
|
||||
var payload = {};
|
||||
payload[ajaxify.data.category.cid] = {
|
||||
parentCid: 0
|
||||
parentCid: 0,
|
||||
};
|
||||
|
||||
socket.emit('admin.categories.update', payload, function (err) {
|
||||
@@ -220,7 +220,7 @@ define('admin/manage/category', [
|
||||
var tagEl = $('#tag-whitelist');
|
||||
tagEl.tagsinput({
|
||||
confirmKeys: [13, 44],
|
||||
trimValue: true
|
||||
trimValue: true,
|
||||
});
|
||||
|
||||
ajaxify.data.category.tagWhitelist.forEach(function (tag) {
|
||||
@@ -273,7 +273,7 @@ define('admin/manage/category', [
|
||||
}
|
||||
|
||||
templates.parse('admin/partials/categories/privileges', {
|
||||
privileges: privileges
|
||||
privileges: privileges,
|
||||
}, function (html) {
|
||||
translator.translate(html, function (html) {
|
||||
$('.privilege-table-container').html(html);
|
||||
@@ -310,7 +310,7 @@ define('admin/manage/category', [
|
||||
cid: ajaxify.data.category.cid,
|
||||
privilege: privilege,
|
||||
set: state,
|
||||
member: member
|
||||
member: member,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -332,11 +332,11 @@ define('admin/manage/category', [
|
||||
});
|
||||
|
||||
templates.parse('partials/category_list', {
|
||||
categories: categories
|
||||
categories: categories,
|
||||
}, function (html) {
|
||||
var modal = bootbox.dialog({
|
||||
message: html,
|
||||
title: '[[admin/manage/categories:alert.set-parent-category]]'
|
||||
title: '[[admin/manage/categories:alert.set-parent-category]]',
|
||||
});
|
||||
|
||||
modal.find('li[data-cid]').on('click', function () {
|
||||
@@ -344,7 +344,7 @@ define('admin/manage/category', [
|
||||
payload = {};
|
||||
|
||||
payload[ajaxify.data.category.cid] = {
|
||||
parentCid: parentCid
|
||||
parentCid: parentCid,
|
||||
};
|
||||
|
||||
socket.emit('admin.categories.update', payload, function (err) {
|
||||
@@ -371,7 +371,7 @@ define('admin/manage/category', [
|
||||
var modal = bootbox.dialog({
|
||||
title: '[[admin/manage/categories:alert.find-user]]',
|
||||
message: '<input class="form-control input-lg" placeholder="[[admin/manage/categories:alert.user-search]]" />',
|
||||
show: true
|
||||
show: true,
|
||||
});
|
||||
|
||||
modal.on('shown.bs.modal', function () {
|
||||
@@ -382,7 +382,7 @@ define('admin/manage/category', [
|
||||
cid: ajaxify.data.category.cid,
|
||||
privilege: ['find', 'read', 'topics:read'],
|
||||
set: true,
|
||||
member: ui.item.user.uid
|
||||
member: ui.item.user.uid,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -399,7 +399,7 @@ define('admin/manage/category', [
|
||||
var modal = bootbox.dialog({
|
||||
title: '[[admin/manage/categories:alert.find-group]]',
|
||||
message: '<input class="form-control input-lg" placeholder="[[admin/manage/categories:alert.group-search]]" />',
|
||||
show: true
|
||||
show: true,
|
||||
});
|
||||
|
||||
modal.on('shown.bs.modal', function () {
|
||||
@@ -410,7 +410,7 @@ define('admin/manage/category', [
|
||||
cid: ajaxify.data.category.cid,
|
||||
privilege: ['groups:find', 'groups:read', 'groups:topics:read'],
|
||||
set: true,
|
||||
member: ui.item.group.name
|
||||
member: ui.item.group.name,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -450,7 +450,7 @@ define('admin/manage/category', [
|
||||
}
|
||||
|
||||
templates.parse('admin/partials/categories/select-category', {
|
||||
categories: categories
|
||||
categories: categories,
|
||||
}, function (html) {
|
||||
translator.translate(html, function (html) {
|
||||
function submit() {
|
||||
@@ -467,9 +467,9 @@ define('admin/manage/category', [
|
||||
save: {
|
||||
label: 'Copy',
|
||||
className: 'btn-primary',
|
||||
callback: submit
|
||||
}
|
||||
}
|
||||
callback: submit,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
modal.find('form').on('submit', submit);
|
||||
|
||||
@@ -5,7 +5,7 @@ define('admin/manage/flags', [
|
||||
'autocomplete',
|
||||
'Chart',
|
||||
'components',
|
||||
'translator'
|
||||
'translator',
|
||||
], function (autocomplete, Chart, components, translator) {
|
||||
|
||||
var Flags = {};
|
||||
@@ -105,10 +105,10 @@ define('admin/manage/flags', [
|
||||
pointHoverBackgroundColor: "#fff",
|
||||
pointBorderColor: "#fff",
|
||||
pointHoverBorderColor: "rgba(151,187,205,1)",
|
||||
data: ajaxify.data.analytics
|
||||
}
|
||||
]
|
||||
}
|
||||
data: ajaxify.data.analytics,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
dailyCanvas.width = $(dailyCanvas).parent().width();
|
||||
@@ -119,16 +119,16 @@ define('admin/manage/flags', [
|
||||
responsive: true,
|
||||
animation: false,
|
||||
legend: {
|
||||
display: false
|
||||
display: false,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
beginAtZero: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ define('admin/manage/flags', [
|
||||
|
||||
socket.emit('posts.updateFlag', {
|
||||
pid: pid,
|
||||
data: formData
|
||||
data: formData,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -5,7 +5,7 @@ define('admin/manage/group', [
|
||||
'forum/groups/memberlist',
|
||||
'iconSelect',
|
||||
'admin/modules/colorpicker',
|
||||
'translator'
|
||||
'translator',
|
||||
], function (memberList, iconSelect, colorpicker, translator) {
|
||||
var Groups = {};
|
||||
|
||||
@@ -59,7 +59,7 @@ define('admin/manage/group', [
|
||||
'data-userslug': results.users[x].userslug,
|
||||
'data-picture': results.users[x].picture,
|
||||
'data-usericon-bgColor': results.users[x]['icon:bgColor'],
|
||||
'data-usericon-text': results.users[x]['icon:text']
|
||||
'data-usericon-text': results.users[x]['icon:text'],
|
||||
})
|
||||
.append(results.users[x].picture ?
|
||||
$('<img />').addClass('avatar avatar-sm').attr('src', results.users[x].picture) :
|
||||
@@ -81,7 +81,7 @@ define('admin/manage/group', [
|
||||
|
||||
socket.emit('admin.groups.join', {
|
||||
groupName: groupName,
|
||||
uid: uid
|
||||
uid: uid,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -93,7 +93,7 @@ define('admin/manage/group', [
|
||||
userslug: userLabel.attr('data-userslug'),
|
||||
picture: userLabel.attr('data-picture'),
|
||||
"icon:bgColor": userLabel.attr('data-usericon-bgColor'),
|
||||
"icon:text": userLabel.attr('data-usericon-text')
|
||||
"icon:text": userLabel.attr('data-usericon-text'),
|
||||
};
|
||||
|
||||
templates.parse('partials/groups/memberlist', 'members', {group: {isOwner: ajaxify.data.group.isOwner, members: [member]}}, function (html) {
|
||||
@@ -116,7 +116,7 @@ define('admin/manage/group', [
|
||||
case 'toggleOwnership':
|
||||
socket.emit('groups.' + (isOwner ? 'rescind' : 'grant'), {
|
||||
toUid: uid,
|
||||
groupName: groupName
|
||||
groupName: groupName,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -132,7 +132,7 @@ define('admin/manage/group', [
|
||||
}
|
||||
socket.emit('admin.groups.leave', {
|
||||
uid: uid,
|
||||
groupName: groupName
|
||||
groupName: groupName,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -167,8 +167,8 @@ define('admin/manage/group', [
|
||||
userTitleEnabled: $('#group-userTitleEnabled').is(':checked'),
|
||||
private: $('#group-private').is(':checked'),
|
||||
hidden: $('#group-hidden').is(':checked'),
|
||||
disableJoinRequests: $('#group-disableJoinRequests').is(':checked')
|
||||
}
|
||||
disableJoinRequests: $('#group-disableJoinRequests').is(':checked'),
|
||||
},
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -30,7 +30,7 @@ define('admin/manage/groups', ['translator'], function (translator) {
|
||||
createModalGo.on('click', function () {
|
||||
var submitObj = {
|
||||
name: createGroupName.val(),
|
||||
description: $('#create-group-desc').val()
|
||||
description: $('#create-group-desc').val(),
|
||||
},
|
||||
errorText;
|
||||
|
||||
@@ -61,7 +61,7 @@ define('admin/manage/groups', ['translator'], function (translator) {
|
||||
bootbox.confirm('[[admin/manage/groups:alerts.confirm-delete]]', function (confirm) {
|
||||
if (confirm) {
|
||||
socket.emit('groups.delete', {
|
||||
groupName: groupName
|
||||
groupName: groupName,
|
||||
}, function (err, data) {
|
||||
if(err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -86,15 +86,15 @@ define('admin/manage/groups', ['translator'], function (translator) {
|
||||
socket.emit('groups.search', {
|
||||
query: queryEl.val(),
|
||||
options: {
|
||||
sort: 'date'
|
||||
}
|
||||
sort: 'date',
|
||||
},
|
||||
}, function (err, groups) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
templates.parse('admin/manage/groups', 'groups', {
|
||||
groups: groups
|
||||
groups: groups,
|
||||
}, function (html) {
|
||||
translator.translate(html, function (html) {
|
||||
groupsEl.find('[data-groupname]').remove();
|
||||
|
||||
@@ -27,7 +27,7 @@ define('admin/manage/ip-blacklist', ['translator'], function (translator) {
|
||||
|
||||
$('[data-action="test"]').on('click', function () {
|
||||
socket.emit('blacklist.validate', {
|
||||
rules: blacklist.val()
|
||||
rules: blacklist.val(),
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
define('admin/manage/tags', [
|
||||
'forum/infinitescroll',
|
||||
'admin/modules/selectable',
|
||||
'admin/modules/colorpicker'
|
||||
'admin/modules/colorpicker',
|
||||
], function (infinitescroll, selectable, colorpicker) {
|
||||
var Tags = {},
|
||||
timeoutId = 0;
|
||||
@@ -38,7 +38,7 @@ define('admin/manage/tags', [
|
||||
|
||||
createModalGo.on('click', function () {
|
||||
socket.emit('admin.tags.create', {
|
||||
tag: createTagName.val()
|
||||
tag: createTagName.val(),
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -109,9 +109,9 @@ define('admin/manage/tags', [
|
||||
|
||||
save(tag);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
handleColorPickers(modal);
|
||||
@@ -156,7 +156,7 @@ define('admin/manage/tags', [
|
||||
var data = {
|
||||
tag: tag.attr('data-tag'),
|
||||
bgColor : tag.find('[data-name="bgColor"]').val(),
|
||||
color : tag.find('[data-name="color"]').val()
|
||||
color : tag.find('[data-name="color"]').val(),
|
||||
};
|
||||
|
||||
socket.emit('admin.tags.update', data, function (err) {
|
||||
|
||||
@@ -91,7 +91,7 @@ define('admin/manage/users', ['translator'], function (translator) {
|
||||
buttons: {
|
||||
close: {
|
||||
label: '[[global:close]]',
|
||||
className: 'btn-link'
|
||||
className: 'btn-link',
|
||||
},
|
||||
submit: {
|
||||
label: '[[admin/manage/users:alerts.button-ban-x, ' + uids.length + ']]',
|
||||
@@ -102,9 +102,9 @@ define('admin/manage/users', ['translator'], function (translator) {
|
||||
}, {});
|
||||
var until = formData.length ? (Date.now() + formData.length * 1000 * 60 * 60 * (parseInt(formData.unit, 10) ? 24 : 1)) : 0;
|
||||
socket.emit('user.banUsers', { uids: uids, until: until, reason: formData.reason }, done('[[admin/manage/users:alerts.ban-success]]', '.ban', true));
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -266,7 +266,7 @@ define('admin/manage/users', ['translator'], function (translator) {
|
||||
buttons: {
|
||||
cancel: {
|
||||
label: '[[admin/manage/users:alerts.button-cancel]]',
|
||||
className: 'btn-link'
|
||||
className: 'btn-link',
|
||||
},
|
||||
create: {
|
||||
label: '[[admin/manage/users:alerts.button-create]]',
|
||||
@@ -274,9 +274,9 @@ define('admin/manage/users', ['translator'], function (translator) {
|
||||
callback: function () {
|
||||
createUser.call(this);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -298,7 +298,7 @@ define('admin/manage/users', ['translator'], function (translator) {
|
||||
var user = {
|
||||
username: username,
|
||||
email: email,
|
||||
password: password
|
||||
password: password,
|
||||
};
|
||||
|
||||
socket.emit('admin.user.createUser', user, function (err) {
|
||||
|
||||
@@ -19,7 +19,7 @@ define('admin/modules/colorpicker', function () {
|
||||
},
|
||||
onShow: function (colpkr) {
|
||||
$(colpkr).css('z-index', 1051);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ define('admin/modules/instance', function () {
|
||||
type: 'info',
|
||||
title: 'Reloading... <i class="fa fa-spin fa-refresh"></i>',
|
||||
message: 'NodeBB is reloading.',
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
$(window).one('action:reconnected', function () {
|
||||
@@ -20,7 +20,7 @@ define('admin/modules/instance', function () {
|
||||
type: 'success',
|
||||
title: '<i class="fa fa-check"></i> Success',
|
||||
message: 'NodeBB has reloaded successfully.',
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
@@ -37,7 +37,7 @@ define('admin/modules/instance', function () {
|
||||
type: 'info',
|
||||
title: 'Rebuilding... <i class="fa fa-spin fa-refresh"></i>',
|
||||
message: 'NodeBB is rebuilding front-end assets (css, javascript, etc).',
|
||||
timeout: 10000
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
$(window).one('action:reconnected', function () {
|
||||
@@ -46,7 +46,7 @@ define('admin/modules/instance', function () {
|
||||
type: 'success',
|
||||
title: '<i class="fa fa-check"></i> Success',
|
||||
message: 'NodeBB has successfully restarted.',
|
||||
timeout: 10000
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
@@ -60,7 +60,7 @@ define('admin/modules/instance', function () {
|
||||
type: 'info',
|
||||
title: 'Build Complete!... <i class="fa fa-spin fa-refresh"></i>',
|
||||
message: 'NodeBB is reloading.',
|
||||
timeout: 10000
|
||||
timeout: 10000,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ define('admin/modules/search', ['mousetrap'], function (mousetrap) {
|
||||
// and wrap the match in a `.search-match` element
|
||||
.replace(
|
||||
new RegExp('^[\\s\\S]*?(.{0,25})(' + term + ')(.{0,25})[\\s\\S]*?$', 'gmi'),
|
||||
'...$1<span class="search-match">$2</span>$3...<br>'
|
||||
'...$1<span class="search-match">$2</span>$3...<br>',
|
||||
)
|
||||
// collapse whitespace
|
||||
.replace(/(?:\n ?)+/g, '\n')
|
||||
@@ -29,7 +29,7 @@ define('admin/modules/search', ['mousetrap'], function (mousetrap) {
|
||||
|
||||
title = title.replace(
|
||||
new RegExp('(^.*?)(' + term + ')(.*?$)', 'gi'),
|
||||
'$1<span class="search-match">$2</span>$3'
|
||||
'$1<span class="search-match">$2</span>$3',
|
||||
);
|
||||
|
||||
return '<li role="presentation" class="result">' +
|
||||
|
||||
@@ -7,7 +7,7 @@ define('admin/modules/selectable', ['jqueryui'], function (jqueryui) {
|
||||
|
||||
selectable.enable = function (containerEl, targets) {
|
||||
$(containerEl).selectable({
|
||||
filter: targets
|
||||
filter: targets,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ define('admin/settings', ['uploader'], function (uploader) {
|
||||
timeout: 2500,
|
||||
title: 'Changes Not Saved',
|
||||
message: 'NodeBB encountered a problem saving your changes',
|
||||
type: 'danger'
|
||||
type: 'danger',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ define('admin/settings', ['uploader'], function (uploader) {
|
||||
timeout: 2500,
|
||||
title: 'Changes Saved',
|
||||
message: 'Your changes to the NodeBB configuration have been saved.',
|
||||
type: 'success'
|
||||
type: 'success',
|
||||
});
|
||||
|
||||
$(window).trigger('action:admin.settingsSaved');
|
||||
@@ -126,7 +126,7 @@ define('admin/settings', ['uploader'], function (uploader) {
|
||||
route: uploadBtn.attr('data-route'),
|
||||
params: {},
|
||||
showHelp: uploadBtn.attr('data-help') ? uploadBtn.attr('data-help') === 1 : undefined,
|
||||
accept: uploadBtn.attr('data-accept')
|
||||
accept: uploadBtn.attr('data-accept'),
|
||||
}, function (image) {
|
||||
// need to move these into template, ex data-callback
|
||||
if (ajaxify.currentPage === 'admin/general/sounds') {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/* globals define */
|
||||
|
||||
define('admin/settings/cookies', [
|
||||
'admin/modules/colorpicker'
|
||||
'admin/modules/colorpicker',
|
||||
], function (colorpicker) {
|
||||
var Module = {};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ $(document).ready(function () {
|
||||
if (ev !== null && ev.state) {
|
||||
if (ev.state.url === null && ev.state.returnPath !== undefined) {
|
||||
window.history.replaceState({
|
||||
url: ev.state.returnPath
|
||||
url: ev.state.returnPath,
|
||||
}, ev.state.returnPath, config.relative_path + '/' + ev.state.returnPath);
|
||||
} else if (ev.state.url !== undefined) {
|
||||
ajaxify.go(ev.state.url, function () {
|
||||
@@ -116,7 +116,7 @@ $(document).ready(function () {
|
||||
url = ajaxify.removeRelativePath(url.replace(/^\/|\/$/g, ''));
|
||||
|
||||
var payload = {
|
||||
url: url
|
||||
url: url,
|
||||
};
|
||||
|
||||
$(window).trigger('action:ajaxify.start', payload);
|
||||
@@ -128,7 +128,7 @@ $(document).ready(function () {
|
||||
ajaxify.currentPage = url.split(/[?#]/)[0];
|
||||
if (window.history && window.history.pushState) {
|
||||
window.history[!quiet ? 'pushState' : 'replaceState']({
|
||||
url: url
|
||||
url: url,
|
||||
}, url, RELATIVE_PATH + '/' + url);
|
||||
}
|
||||
};
|
||||
@@ -243,7 +243,7 @@ $(document).ready(function () {
|
||||
}
|
||||
var data = {
|
||||
tpl_url: tpl_url,
|
||||
scripts: [location + tpl_url]
|
||||
scripts: [location + tpl_url],
|
||||
};
|
||||
|
||||
$(window).trigger('action:script.load', data);
|
||||
@@ -291,7 +291,7 @@ $(document).ready(function () {
|
||||
url: RELATIVE_PATH + '/api/' + url,
|
||||
cache: false,
|
||||
headers: {
|
||||
'X-Return-To': app.previousUrl
|
||||
'X-Return-To': app.previousUrl,
|
||||
},
|
||||
success: function (data) {
|
||||
if (!data) {
|
||||
@@ -311,9 +311,9 @@ $(document).ready(function () {
|
||||
}
|
||||
callback({
|
||||
data: data,
|
||||
textStatus: textStatus
|
||||
textStatus: textStatus,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -329,7 +329,7 @@ $(document).ready(function () {
|
||||
},
|
||||
error: function (error) {
|
||||
throw new Error("Unable to load template: " + template + " (" + error.statusText + ")");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ app.cacheBuster = null;
|
||||
app.cacheBuster = config['cache-buster'];
|
||||
|
||||
bootbox.setDefaults({
|
||||
locale: config.userLang
|
||||
locale: config.userLang,
|
||||
});
|
||||
|
||||
app.load = function () {
|
||||
@@ -69,7 +69,7 @@ app.cacheBuster = null;
|
||||
clickfn: function () {
|
||||
window.location.reload();
|
||||
},
|
||||
type: 'warning'
|
||||
type: 'warning',
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -99,16 +99,16 @@ app.cacheBuster = null;
|
||||
$.ajax(config.relative_path + '/logout', {
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'x-csrf-token': config.csrf_token
|
||||
'x-csrf-token': config.csrf_token,
|
||||
},
|
||||
success: function () {
|
||||
var payload = {
|
||||
next: config.relative_path + '/'
|
||||
next: config.relative_path + '/',
|
||||
};
|
||||
|
||||
$(window).trigger('action:app.loggedOut', payload);
|
||||
window.location.href = payload.next;
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -129,7 +129,7 @@ app.cacheBuster = null;
|
||||
title: '[[global:alert.success]]',
|
||||
message: message,
|
||||
type: 'success',
|
||||
timeout: timeout ? timeout : 5000
|
||||
timeout: timeout ? timeout : 5000,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -144,7 +144,7 @@ app.cacheBuster = null;
|
||||
title: '[[global:alert.error]]',
|
||||
message: message,
|
||||
type: 'danger',
|
||||
timeout: timeout ? timeout : 10000
|
||||
timeout: timeout ? timeout : 10000,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -164,7 +164,7 @@ app.cacheBuster = null;
|
||||
closeButton: false,
|
||||
callback: function () {
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -176,7 +176,7 @@ app.cacheBuster = null;
|
||||
var previousRoom = app.currentRoom;
|
||||
app.currentRoom = room;
|
||||
socket.emit('meta.rooms.enter', {
|
||||
enter: room
|
||||
enter: room,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
app.currentRoom = previousRoom;
|
||||
@@ -214,7 +214,7 @@ app.cacheBuster = null;
|
||||
if (!utils.isTouchDevice()) {
|
||||
$(this).tooltip({
|
||||
placement: placement || $(this).attr('title-placement') || 'top',
|
||||
title: $(this).attr('title')
|
||||
title: $(this).attr('title'),
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -224,7 +224,7 @@ app.cacheBuster = null;
|
||||
if (!utils.isTouchDevice()) {
|
||||
$('body').tooltip({
|
||||
selector:'.fa-circle.status',
|
||||
placement: 'top'
|
||||
placement: 'top',
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -263,13 +263,13 @@ app.cacheBuster = null;
|
||||
login: {
|
||||
format: 'alert',
|
||||
title: '[[global:welcome_back]] ' + app.user.username + '!',
|
||||
message: '[[global:you_have_successfully_logged_in]]'
|
||||
message: '[[global:you_have_successfully_logged_in]]',
|
||||
},
|
||||
banned: {
|
||||
format: 'modal',
|
||||
title: '[[error:user-banned]]',
|
||||
message: '[[error:user-banned-reason, ' + utils.params().banned + ']]'
|
||||
}
|
||||
message: '[[error:user-banned-reason, ' + utils.params().banned + ']]',
|
||||
},
|
||||
};
|
||||
|
||||
function showAlert(type) {
|
||||
@@ -279,7 +279,7 @@ app.cacheBuster = null;
|
||||
type: 'success',
|
||||
title: messages[type].title,
|
||||
message: messages[type].message,
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
break;
|
||||
|
||||
@@ -288,7 +288,7 @@ app.cacheBuster = null;
|
||||
translator.translate(messages[type].message, function (translated) {
|
||||
bootbox.alert({
|
||||
title: messages[type].title,
|
||||
message: translated
|
||||
message: translated,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -368,7 +368,7 @@ app.cacheBuster = null;
|
||||
var titleObj = {
|
||||
active: false,
|
||||
interval: undefined,
|
||||
titles: []
|
||||
titles: [],
|
||||
};
|
||||
|
||||
app.alternatingTitle = function (title) {
|
||||
@@ -439,7 +439,7 @@ app.cacheBuster = null;
|
||||
$(this).tooltip({
|
||||
placement: 'bottom',
|
||||
trigger: 'hover',
|
||||
title: $(this).attr('title')
|
||||
title: $(this).attr('title'),
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -448,7 +448,7 @@ app.cacheBuster = null;
|
||||
$('#search-form').parent().tooltip({
|
||||
placement: 'bottom',
|
||||
trigger: 'hover',
|
||||
title: $('#search-button i').attr('title')
|
||||
title: $('#search-button i').attr('title'),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ app.cacheBuster = null;
|
||||
$('#user_dropdown').tooltip({
|
||||
placement: 'bottom',
|
||||
trigger: 'hover',
|
||||
title: $('#user_dropdown').attr('title')
|
||||
title: $('#user_dropdown').attr('title'),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -482,7 +482,7 @@ app.cacheBuster = null;
|
||||
if (!config.loggedIn && !config.allowGuestSearching) {
|
||||
app.alert({
|
||||
message:'[[error:search-requires-login]]',
|
||||
timeout: 3000
|
||||
timeout: 3000,
|
||||
});
|
||||
ajaxify.go('login');
|
||||
return false;
|
||||
@@ -547,7 +547,7 @@ app.cacheBuster = null;
|
||||
app.newTopic = function (cid, tags) {
|
||||
$(window).trigger('action:composer.topic.new', {
|
||||
cid: cid || ajaxify.data.cid || 0,
|
||||
tags: tags || (ajaxify.data.tag ? [ajaxify.data.tag] : [])
|
||||
tags: tags || (ajaxify.data.tag ? [ajaxify.data.tag] : []),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -570,7 +570,7 @@ app.cacheBuster = null;
|
||||
var msg = {
|
||||
alert_id: 'email_confirm',
|
||||
type: 'warning',
|
||||
timeout: 0
|
||||
timeout: 0,
|
||||
};
|
||||
|
||||
if (!app.user.email) {
|
||||
|
||||
@@ -16,7 +16,7 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
yearRange: '1900:-5y',
|
||||
defaultDate: '-13y'
|
||||
defaultDate: '-13y',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
||||
location: $('#inputLocation').val(),
|
||||
groupTitle: $('#groupTitle').val(),
|
||||
signature: $('#inputSignature').val(),
|
||||
aboutme: $('#inputAboutMe').val()
|
||||
aboutme: $('#inputAboutMe').val(),
|
||||
};
|
||||
|
||||
$(window).trigger('action:profile.update', userData);
|
||||
@@ -86,7 +86,7 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
||||
templates.parse('partials/modals/change_picture_modal', {
|
||||
pictures: pictures,
|
||||
uploaded: uploaded,
|
||||
allowProfileImageUploads: ajaxify.data.allowProfileImageUploads
|
||||
allowProfileImageUploads: ajaxify.data.allowProfileImageUploads,
|
||||
}, function (html) {
|
||||
translator.translate(html, function (html) {
|
||||
var modal = bootbox.dialog({
|
||||
@@ -98,13 +98,13 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
||||
close: {
|
||||
label: '[[global:close]]',
|
||||
callback: onCloseModal,
|
||||
className: 'btn-link'
|
||||
className: 'btn-link',
|
||||
},
|
||||
update: {
|
||||
label: '[[global:save_changes]]',
|
||||
callback: saveSelection
|
||||
}
|
||||
}
|
||||
callback: saveSelection,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
modal.on('shown.bs.modal', updateImages);
|
||||
@@ -222,7 +222,7 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
||||
fileSize: ajaxify.data.maximumProfileImageSize,
|
||||
title: '[[user:upload_picture]]',
|
||||
description: '[[user:upload_a_picture]]',
|
||||
accept: '.png,.jpg,.bmp'
|
||||
accept: '.png,.jpg,.bmp',
|
||||
}, function (url) {
|
||||
onUploadComplete(url);
|
||||
});
|
||||
@@ -288,7 +288,7 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
||||
function changeUserPicture(type, callback) {
|
||||
socket.emit('user.changePicture', {
|
||||
type: type,
|
||||
uid: ajaxify.data.theirid
|
||||
uid: ajaxify.data.theirid,
|
||||
}, callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ define('forum/account/edit/email', ['forum/account/header'], function (header) {
|
||||
var userData = {
|
||||
uid: $('#inputUID').val(),
|
||||
email: $('#inputNewEmail').val(),
|
||||
password: $('#inputCurrentPassword').val()
|
||||
password: $('#inputCurrentPassword').val(),
|
||||
};
|
||||
|
||||
if (!userData.email) {
|
||||
|
||||
@@ -66,7 +66,7 @@ define('forum/account/edit/password', ['forum/account/header', 'translator'], fu
|
||||
socket.emit('user.changePassword', {
|
||||
'currentPassword': currentPassword.val(),
|
||||
'newPassword': password.val(),
|
||||
'uid': ajaxify.data.theirid
|
||||
'uid': ajaxify.data.theirid,
|
||||
}, function (err) {
|
||||
btn.removeClass('disabled').find('i').addClass('hide');
|
||||
currentPassword.val('');
|
||||
|
||||
@@ -12,7 +12,7 @@ define('forum/account/edit/username', ['forum/account/header'], function (header
|
||||
var userData = {
|
||||
uid: $('#inputUID').val(),
|
||||
username: $('#inputNewUsername').val(),
|
||||
password: $('#inputCurrentPassword').val()
|
||||
password: $('#inputCurrentPassword').val(),
|
||||
};
|
||||
|
||||
if (!userData.username) {
|
||||
|
||||
@@ -5,7 +5,7 @@ define('forum/account/header', [
|
||||
'coverPhoto',
|
||||
'pictureCropper',
|
||||
'components',
|
||||
'translator'
|
||||
'translator',
|
||||
], function (coverPhoto, pictureCropper, components, translator) {
|
||||
var AccountHeader = {};
|
||||
var isAdminOrSelfOrGlobalMod;
|
||||
@@ -76,7 +76,7 @@ define('forum/account/header', [
|
||||
socket.emit('user.updateCover', {
|
||||
uid: ajaxify.data.uid,
|
||||
imageData: imageData,
|
||||
position: position
|
||||
position: position,
|
||||
}, callback);
|
||||
},
|
||||
function () {
|
||||
@@ -86,18 +86,18 @@ define('forum/account/header', [
|
||||
aspectRatio: '16 / 9',
|
||||
paramName: 'uid',
|
||||
paramValue: ajaxify.data.theirid,
|
||||
accept: '.png,.jpg,.bmp'
|
||||
accept: '.png,.jpg,.bmp',
|
||||
}, function (imageUrlOnServer) {
|
||||
components.get('account/cover').css('background-image', 'url(' + imageUrlOnServer + '?' + config['cache-buster'] + ')');
|
||||
});
|
||||
},
|
||||
removeCover
|
||||
removeCover,
|
||||
);
|
||||
}
|
||||
|
||||
function toggleFollow(type) {
|
||||
socket.emit('user.' + type, {
|
||||
uid: ajaxify.data.uid
|
||||
uid: ajaxify.data.uid,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -120,7 +120,7 @@ define('forum/account/header', [
|
||||
buttons: {
|
||||
close: {
|
||||
label: '[[global:close]]',
|
||||
className: 'btn-link'
|
||||
className: 'btn-link',
|
||||
},
|
||||
submit: {
|
||||
label: '[[user:ban_account]]',
|
||||
@@ -137,9 +137,9 @@ define('forum/account/header', [
|
||||
}
|
||||
ajaxify.refresh();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -179,7 +179,7 @@ define('forum/account/header', [
|
||||
}
|
||||
|
||||
socket.emit('user.removeCover', {
|
||||
uid: ajaxify.data.uid
|
||||
uid: ajaxify.data.uid,
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
ajaxify.refresh();
|
||||
|
||||
@@ -35,8 +35,8 @@ define('forum/account/info', ['forum/account/header', 'components'], function (h
|
||||
url: config.relative_path + '/api/user/' + ajaxify.data.userslug + '/session/' + uuid,
|
||||
method: 'delete',
|
||||
headers: {
|
||||
'x-csrf-token': config.csrf_token
|
||||
}
|
||||
'x-csrf-token': config.csrf_token,
|
||||
},
|
||||
}).done(function () {
|
||||
parentEl.remove();
|
||||
}).fail(function (err) {
|
||||
|
||||
@@ -29,7 +29,7 @@ define('forum/account/posts', ['forum/account/header', 'forum/infinitescroll'],
|
||||
|
||||
infinitescroll.loadMore(method, {
|
||||
uid: ajaxify.data.theirid,
|
||||
after: $('[component="posts"]').attr('data-nextstart')
|
||||
after: $('[component="posts"]').attr('data-nextstart'),
|
||||
}, function (data, done) {
|
||||
if (data.posts && data.posts.length) {
|
||||
onPostsLoaded(data.posts, done);
|
||||
|
||||
@@ -6,7 +6,7 @@ define('forum/account/profile', [
|
||||
'forum/account/header',
|
||||
'forum/infinitescroll',
|
||||
'translator',
|
||||
'components'
|
||||
'components',
|
||||
], function (header, infinitescroll, translator) {
|
||||
var Account = {};
|
||||
var theirid;
|
||||
@@ -49,7 +49,7 @@ define('forum/account/profile', [
|
||||
|
||||
infinitescroll.loadMore('posts.loadMoreUserPosts', {
|
||||
after: $('[component="posts"]').attr('data-nextstart'),
|
||||
uid: theirid
|
||||
uid: theirid,
|
||||
}, function (data, done) {
|
||||
if (data.posts && data.posts.length) {
|
||||
onPostsLoaded(data.posts, done);
|
||||
|
||||
@@ -99,7 +99,7 @@ define('forum/account/settings', ['forum/account/header', 'components', 'sounds'
|
||||
timeout: 5000,
|
||||
clickfn: function () {
|
||||
ajaxify.refresh();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ define('forum/account/topics', ['forum/account/header', 'forum/infinitescroll'],
|
||||
|
||||
infinitescroll.loadMore('topics.loadMoreFromSet', {
|
||||
set: set,
|
||||
after: $('[component="category"]').attr('data-nextstart')
|
||||
after: $('[component="category"]').attr('data-nextstart'),
|
||||
}, function (data, done) {
|
||||
if (data.topics && data.topics.length) {
|
||||
onTopicsLoaded(data.topics, done);
|
||||
|
||||
@@ -18,7 +18,7 @@ define('forum/categories', ['components', 'translator'], function (components, t
|
||||
socket.on('event:new_post', categories.onNewPost);
|
||||
|
||||
$('.category-header').tooltip({
|
||||
placement: 'bottom'
|
||||
placement: 'bottom',
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ define('forum/category', [
|
||||
'components',
|
||||
'translator',
|
||||
'topicSelect',
|
||||
'forum/pagination'
|
||||
'forum/pagination',
|
||||
], function (infinitescroll, share, navigator, categoryTools, sort, components, translator, topicSelect, pagination) {
|
||||
var Category = {};
|
||||
|
||||
@@ -178,7 +178,7 @@ define('forum/category', [
|
||||
|
||||
if (scrollTo.length) {
|
||||
$('html, body').animate({
|
||||
scrollTop: (scrollTo.offset().top - offset) + 'px'
|
||||
scrollTop: (scrollTo.offset().top - offset) + 'px',
|
||||
}, duration !== undefined ? duration : 400, function () {
|
||||
Category.highlightTopic(clickedIndex);
|
||||
navigator.update();
|
||||
@@ -208,7 +208,7 @@ define('forum/category', [
|
||||
privileges: {editable: editable},
|
||||
showSelect: editable,
|
||||
topics: [topic],
|
||||
template: {category: true}
|
||||
template: {category: true},
|
||||
}, function (html) {
|
||||
translator.translate(html, function (translatedHTML) {
|
||||
var topic = $(translatedHTML),
|
||||
@@ -287,7 +287,7 @@ define('forum/category', [
|
||||
direction: direction,
|
||||
author: params.author,
|
||||
tag: params.tag,
|
||||
categoryTopicSort: config.categoryTopicSort
|
||||
categoryTopicSort: config.categoryTopicSort,
|
||||
}, function (data, done) {
|
||||
if (data.topics && data.topics.length) {
|
||||
Category.onTopicsLoaded(data, direction, done);
|
||||
|
||||
@@ -8,7 +8,7 @@ define('forum/category/tools', [
|
||||
'forum/topic/move',
|
||||
'topicSelect',
|
||||
'components',
|
||||
'translator'
|
||||
'translator',
|
||||
], function (move, topicSelect, components, translator) {
|
||||
|
||||
var CategoryTools = {};
|
||||
@@ -262,7 +262,7 @@ define('forum/category/tools', [
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ define('forum/chats', [
|
||||
'mousetrap',
|
||||
'forum/chats/recent',
|
||||
'forum/chats/search',
|
||||
'forum/chats/messages'
|
||||
'forum/chats/messages',
|
||||
], function (components, translator, mousetrap, recentChats, search, messages) {
|
||||
var Chats = {
|
||||
initialised: false
|
||||
initialised: false,
|
||||
};
|
||||
|
||||
var newMessage = false;
|
||||
@@ -207,8 +207,8 @@ define('forum/chats', [
|
||||
this.$el.css(this._applyPlacement(position));
|
||||
this.$el.css('position', 'absolute');
|
||||
return this;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
$(window).trigger('chat:autocomplete:init', data);
|
||||
@@ -220,7 +220,7 @@ define('forum/chats', [
|
||||
Chats.createTagsInput = function (tagEl, data) {
|
||||
tagEl.tagsinput({
|
||||
confirmKeys: [13, 44],
|
||||
trimValue: true
|
||||
trimValue: true,
|
||||
});
|
||||
|
||||
if (data.users && data.users.length) {
|
||||
@@ -322,7 +322,7 @@ define('forum/chats', [
|
||||
} else {
|
||||
var recentEl = components.get('chat/recent');
|
||||
templates.parse('partials/chats/recent_room', {
|
||||
rooms: { "roomId": data.roomId, "lastUser": data.message.fromUser, "usernames": data.message.fromUser.username, "unread": true }
|
||||
rooms: { "roomId": data.roomId, "lastUser": data.message.fromUser, "usernames": data.message.fromUser.username, "unread": true },
|
||||
}, function (html) {
|
||||
translator.translate(html, function (translated) {
|
||||
recentEl.prepend(translated);
|
||||
|
||||
@@ -24,13 +24,13 @@ define('forum/chats/messages', ['components', 'sounds', 'translator'], function
|
||||
$(window).trigger('action:chat.sent', {
|
||||
roomId: roomId,
|
||||
message: msg,
|
||||
mid: mid
|
||||
mid: mid,
|
||||
});
|
||||
|
||||
if (!mid) {
|
||||
socket.emit('modules.chats.send', {
|
||||
roomId: roomId,
|
||||
message: msg
|
||||
message: msg,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
inputEl.val(msg);
|
||||
@@ -46,7 +46,7 @@ define('forum/chats/messages', ['components', 'sounds', 'translator'], function
|
||||
socket.emit('modules.chats.edit', {
|
||||
roomId: roomId,
|
||||
mid: mid,
|
||||
message: msg
|
||||
message: msg,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
inputEl.val(msg);
|
||||
@@ -81,7 +81,7 @@ define('forum/chats/messages', ['components', 'sounds', 'translator'], function
|
||||
|
||||
messages.parseMessage = function (data, callback) {
|
||||
templates.parse('partials/chats/message' + (Array.isArray(data) ? 's' : ''), {
|
||||
messages: data
|
||||
messages: data,
|
||||
}, function (html) {
|
||||
translator.translate(html, callback);
|
||||
});
|
||||
@@ -91,7 +91,7 @@ define('forum/chats/messages', ['components', 'sounds', 'translator'], function
|
||||
messages.scrollToBottom = function (containerEl) {
|
||||
if (containerEl.length) {
|
||||
containerEl.scrollTop(
|
||||
containerEl[0].scrollHeight - containerEl.height()
|
||||
containerEl[0].scrollHeight - containerEl.height(),
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -136,7 +136,7 @@ define('forum/chats/messages', ['components', 'sounds', 'translator'], function
|
||||
|
||||
socket.emit('modules.chats.delete', {
|
||||
messageId: messageId,
|
||||
roomId: roomId
|
||||
roomId: roomId,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -24,7 +24,7 @@ define('forum/chats/recent', function () {
|
||||
recentChats.attr('loading', 1);
|
||||
socket.emit('modules.chats.getRecentChats', {
|
||||
uid: ajaxify.data.uid,
|
||||
after: recentChats.attr('data-nextstart')
|
||||
after: recentChats.attr('data-nextstart'),
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -29,7 +29,7 @@ define('forum/chats/search', ['components'], function (components) {
|
||||
|
||||
socket.emit('user.search', {
|
||||
query: username,
|
||||
searchBy: 'username'
|
||||
searchBy: 'username',
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -10,7 +10,7 @@ define('forum/compose', [], function () {
|
||||
|
||||
if (container.length) {
|
||||
$(window).trigger('action:composer.enhance', {
|
||||
container: container
|
||||
container: container,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ define('forum/groups/details', [
|
||||
'coverPhoto',
|
||||
'pictureCropper',
|
||||
'translator',
|
||||
'vendor/colorpicker/colorpicker'
|
||||
'vendor/colorpicker/colorpicker',
|
||||
], function (memberList, iconSelect, components, coverPhoto, pictureCropper, translator) {
|
||||
|
||||
var Details = {};
|
||||
@@ -27,7 +27,7 @@ define('forum/groups/details', [
|
||||
socket.emit('groups.cover.update', {
|
||||
groupName: groupName,
|
||||
imageData: imageData,
|
||||
position: position
|
||||
position: position,
|
||||
}, callback);
|
||||
},
|
||||
function () {
|
||||
@@ -36,12 +36,12 @@ define('forum/groups/details', [
|
||||
socketMethod: 'groups.cover.update',
|
||||
aspectRatio: '16 / 9',
|
||||
paramName: 'groupName',
|
||||
paramValue: groupName
|
||||
paramValue: groupName,
|
||||
}, function (imageUrlOnServer) {
|
||||
components.get('groups/cover').css('background-image', 'url(' + imageUrlOnServer + ')');
|
||||
});
|
||||
},
|
||||
removeCover
|
||||
removeCover,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ define('forum/groups/details', [
|
||||
case 'toggleOwnership':
|
||||
socket.emit('groups.' + (isOwner ? 'rescind' : 'grant'), {
|
||||
toUid: uid,
|
||||
groupName: groupName
|
||||
groupName: groupName,
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
ownerFlagEl.toggleClass('invisible');
|
||||
@@ -76,7 +76,7 @@ define('forum/groups/details', [
|
||||
case 'kick':
|
||||
socket.emit('groups.kick', {
|
||||
uid: uid,
|
||||
groupName: groupName
|
||||
groupName: groupName,
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
userRow.slideUp().remove();
|
||||
@@ -106,7 +106,7 @@ define('forum/groups/details', [
|
||||
case 'rejectAll':
|
||||
socket.emit('groups.' + action, {
|
||||
toUid: uid,
|
||||
groupName: groupName
|
||||
groupName: groupName,
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
ajaxify.refresh();
|
||||
@@ -139,7 +139,7 @@ define('forum/groups/details', [
|
||||
},
|
||||
onShow: function (colpkr) {
|
||||
$(colpkr).css('z-index', 1051);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// Add icon selection interface
|
||||
@@ -188,7 +188,7 @@ define('forum/groups/details', [
|
||||
|
||||
socket.emit('groups.update', {
|
||||
groupName: groupName,
|
||||
values: settings
|
||||
values: settings,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -214,7 +214,7 @@ define('forum/groups/details', [
|
||||
bootbox.prompt('Please enter the name of this group in order to delete it:', function (response) {
|
||||
if (response === groupName) {
|
||||
socket.emit('groups.delete', {
|
||||
groupName: groupName
|
||||
groupName: groupName,
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
app.alertSuccess('[[groups:event.deleted, ' + utils.escapeHTML(groupName) + ']]');
|
||||
@@ -239,7 +239,7 @@ define('forum/groups/details', [
|
||||
autocomplete.user(searchInput, function (event, selected) {
|
||||
socket.emit('groups.issueInvite', {
|
||||
toUid: selected.item.user.uid,
|
||||
groupName: ajaxify.data.group.name
|
||||
groupName: ajaxify.data.group.name,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -256,7 +256,7 @@ define('forum/groups/details', [
|
||||
}
|
||||
socket.emit('groups.issueMassInvite', {
|
||||
usernames: usernames,
|
||||
groupName: ajaxify.data.group.name
|
||||
groupName: ajaxify.data.group.name,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -275,7 +275,7 @@ define('forum/groups/details', [
|
||||
}
|
||||
|
||||
socket.emit('groups.cover.remove', {
|
||||
groupName: ajaxify.data.group.name
|
||||
groupName: ajaxify.data.group.name,
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
ajaxify.refresh();
|
||||
|
||||
@@ -14,7 +14,7 @@ define('forum/groups/list', ['forum/infinitescroll'], function (infinitescroll)
|
||||
bootbox.prompt('[[groups:new-group.group_name]]', function (name) {
|
||||
if (name && name.length) {
|
||||
socket.emit('groups.create', {
|
||||
name: name
|
||||
name: name,
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
ajaxify.go('groups/' + utils.slugify(name));
|
||||
@@ -43,11 +43,11 @@ define('forum/groups/list', ['forum/infinitescroll'], function (infinitescroll)
|
||||
|
||||
infinitescroll.loadMore('groups.loadMore', {
|
||||
sort: $('#search-sort').val(),
|
||||
after: $('[component="groups/container"]').attr('data-nextstart')
|
||||
after: $('[component="groups/container"]').attr('data-nextstart'),
|
||||
}, function (data, done) {
|
||||
if (data && data.groups.length) {
|
||||
templates.parse('partials/groups/list', {
|
||||
groups: data.groups
|
||||
groups: data.groups,
|
||||
}, function (html) {
|
||||
$('#groups-list').append(html);
|
||||
done();
|
||||
@@ -71,8 +71,8 @@ define('forum/groups/list', ['forum/infinitescroll'], function (infinitescroll)
|
||||
query: queryEl.val(),
|
||||
options: {
|
||||
sort: sortEl.val(),
|
||||
filterHidden: true
|
||||
}
|
||||
filterHidden: true,
|
||||
},
|
||||
}, function (err, groups) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -81,7 +81,7 @@ define('forum/groups/list', ['forum/infinitescroll'], function (infinitescroll)
|
||||
return group.name !== 'registered-users' && group.name !== 'guests';
|
||||
});
|
||||
templates.parse('partials/groups/list', {
|
||||
groups: groups
|
||||
groups: groups,
|
||||
}, function (html) {
|
||||
groupsEl.empty().append(html);
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ define('forum/groups/memberlist', ['components', 'forum/infinitescroll'], functi
|
||||
members.attr('loading', 1);
|
||||
socket.emit('groups.loadMoreMembers', {
|
||||
groupName: groupName,
|
||||
after: members.attr('data-nextstart')
|
||||
after: members.attr('data-nextstart'),
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -88,8 +88,8 @@ define('forum/groups/memberlist', ['components', 'forum/infinitescroll'], functi
|
||||
app.parseAndTranslate('groups/details', 'members', {
|
||||
group: {
|
||||
members: users,
|
||||
isOwner: ajaxify.data.group.isOwner
|
||||
}
|
||||
isOwner: ajaxify.data.group.isOwner,
|
||||
},
|
||||
}, callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ define('forum/login', ['translator'], function (translator) {
|
||||
|
||||
formEl.ajaxSubmit({
|
||||
headers: {
|
||||
'x-csrf-token': config.csrf_token
|
||||
'x-csrf-token': config.csrf_token,
|
||||
},
|
||||
success: function (data, status) {
|
||||
window.location.href = data + '?loggedin';
|
||||
@@ -52,7 +52,7 @@ define('forum/login', ['translator'], function (translator) {
|
||||
$('#password').select();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -46,7 +46,7 @@ define('forum/notifications', ['components', 'notifications', 'forum/infinitescr
|
||||
}
|
||||
var notifList = $('.notifications-list');
|
||||
infinitescroll.loadMore('notifications.loadMore', {
|
||||
after: notifList.attr('data-nextstart')
|
||||
after: notifList.attr('data-nextstart'),
|
||||
}, function (data, done) {
|
||||
if (!data) {
|
||||
return done();
|
||||
|
||||
@@ -135,7 +135,7 @@ define('forum/recent', ['forum/infinitescroll', 'components'], function (infinit
|
||||
after: $('[component="category"]').attr('data-nextstart'),
|
||||
cid: utils.params().cid,
|
||||
filter: ajaxify.data.selectedFilter.filter,
|
||||
set: $('[component="category"]').attr('data-set') ? $('[component="category"]').attr('data-set') : 'topics:recent'
|
||||
set: $('[component="category"]').attr('data-set') ? $('[component="category"]').attr('data-set') : 'topics:recent',
|
||||
}, function (data, done) {
|
||||
if (data.topics && data.topics.length) {
|
||||
Recent.onTopicsLoaded('recent', data.topics, false, done);
|
||||
|
||||
@@ -78,7 +78,7 @@ define('forum/register', ['translator'], function (translator) {
|
||||
|
||||
registerBtn.parents('form').ajaxSubmit({
|
||||
headers: {
|
||||
'x-csrf-token': config.csrf_token
|
||||
'x-csrf-token': config.csrf_token,
|
||||
},
|
||||
success: function (data) {
|
||||
registerBtn.removeClass('disabled');
|
||||
@@ -106,7 +106,7 @@ define('forum/register', ['translator'], function (translator) {
|
||||
registerBtn.removeClass('disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -122,7 +122,7 @@ define('forum/register', ['translator'], function (translator) {
|
||||
}
|
||||
|
||||
socket.emit('user.emailExists', {
|
||||
email: email
|
||||
email: email,
|
||||
}, function (err, exists) {
|
||||
if (err) {
|
||||
app.alertError(err.message);
|
||||
@@ -152,7 +152,7 @@ define('forum/register', ['translator'], function (translator) {
|
||||
showError(username_notify, '[[error:invalid-username]]');
|
||||
} else {
|
||||
socket.emit('user.exists', {
|
||||
username: username
|
||||
username: username,
|
||||
}, function (err, exists) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -20,7 +20,7 @@ define('forum/reset_code', function () {
|
||||
resetEl.prop('disabled', true).html('<i class="fa fa-spin fa-refresh"></i> Changing Password');
|
||||
socket.emit('user.reset.commit', {
|
||||
code: reset_code,
|
||||
password: password.val()
|
||||
password: password.val(),
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
ajaxify.refresh();
|
||||
|
||||
@@ -36,7 +36,7 @@ define('forum/search', ['search', 'autocomplete'], function (searchModule, autoc
|
||||
function getSearchData() {
|
||||
var form = $('#advanced-search');
|
||||
var searchData = {
|
||||
in: $('#search-in').val()
|
||||
in: $('#search-in').val(),
|
||||
};
|
||||
searchData.term = $('#search-input').val();
|
||||
if (searchData.in === 'posts' || searchData.in === 'titlesposts' || searchData.in === 'titles') {
|
||||
@@ -168,7 +168,7 @@ define('forum/search', ['search', 'autocomplete'], function (searchModule, autoc
|
||||
var tagEl = $('#has-tags');
|
||||
tagEl.tagsinput({
|
||||
confirmKeys: [13, 44],
|
||||
trimValue: true
|
||||
trimValue: true,
|
||||
});
|
||||
|
||||
autocomplete.tag($('#has-tags').siblings('.bootstrap-tagsinput').find('input'));
|
||||
|
||||
@@ -27,7 +27,7 @@ define('forum/tag', ['forum/recent', 'forum/infinitescroll'], function (recent,
|
||||
|
||||
infinitescroll.loadMore('topics.loadMoreFromSet', {
|
||||
set: 'tag:' + ajaxify.data.tag + ':topics',
|
||||
after: $('[component="category"]').attr('data-nextstart')
|
||||
after: $('[component="category"]').attr('data-nextstart'),
|
||||
}, function (data, done) {
|
||||
if (data.topics && data.topics.length) {
|
||||
recent.onTopicsLoaded('tag', data.topics, false, done);
|
||||
|
||||
@@ -40,7 +40,7 @@ define('forum/tags', ['forum/infinitescroll'], function (infinitescroll) {
|
||||
}
|
||||
|
||||
infinitescroll.loadMore('topics.loadMoreTags', {
|
||||
after: $('.tag-list').attr('data-nextstart')
|
||||
after: $('.tag-list').attr('data-nextstart'),
|
||||
}, function (data, done) {
|
||||
if (data && data.tags && data.tags.length) {
|
||||
onTagsLoaded(data.tags, false, done);
|
||||
@@ -53,7 +53,7 @@ define('forum/tags', ['forum/infinitescroll'], function (infinitescroll) {
|
||||
|
||||
function resetSearch() {
|
||||
socket.emit('topics.loadMoreTags', {
|
||||
after: 0
|
||||
after: 0,
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -12,7 +12,7 @@ define('forum/topic', [
|
||||
'forum/topic/replies',
|
||||
'navigator',
|
||||
'sort',
|
||||
'components'
|
||||
'components',
|
||||
], function (infinitescroll, threadTools, postTools, events, posts, replies, navigator, sort, components) {
|
||||
var Topic = {},
|
||||
currentUrl = '';
|
||||
@@ -162,7 +162,7 @@ define('forum/topic', [
|
||||
},
|
||||
closefn : function () {
|
||||
localStorage.removeItem('topic:' + tid + ':bookmark');
|
||||
}
|
||||
},
|
||||
});
|
||||
setTimeout(function () {
|
||||
app.removeAlert('bookmark');
|
||||
@@ -266,7 +266,7 @@ define('forum/topic', [
|
||||
}
|
||||
|
||||
history.replaceState({
|
||||
url: newUrl + search
|
||||
url: newUrl + search,
|
||||
}, null, window.location.protocol + '//' + window.location.host + RELATIVE_PATH + '/' + newUrl + search);
|
||||
}
|
||||
currentUrl = newUrl;
|
||||
@@ -282,7 +282,7 @@ define('forum/topic', [
|
||||
if (app.user.uid) {
|
||||
socket.emit('topics.bookmark', {
|
||||
'tid': ajaxify.data.tid,
|
||||
'index': index
|
||||
'index': index,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -49,7 +49,7 @@ define('forum/topic/delete-posts', ['components', 'postSelect'], function (compo
|
||||
btn.attr('disabled', true);
|
||||
socket.emit(command, {
|
||||
tid: ajaxify.data.tid,
|
||||
pids: postSelect.pids
|
||||
pids: postSelect.pids,
|
||||
}, function (err) {
|
||||
btn.removeAttr('disabled');
|
||||
if (err) {
|
||||
|
||||
@@ -8,7 +8,7 @@ define('forum/topic/events', [
|
||||
'forum/topic/threadTools',
|
||||
'forum/topic/posts',
|
||||
'components',
|
||||
'translator'
|
||||
'translator',
|
||||
], function (postTools, threadTools, posts, components, translator) {
|
||||
|
||||
var Events = {};
|
||||
@@ -44,7 +44,7 @@ define('forum/topic/events', [
|
||||
'posts.unvote': togglePostVote,
|
||||
|
||||
'event:new_notification': onNewNotification,
|
||||
'event:new_post': posts.onNewPost
|
||||
'event:new_post': posts.onNewPost,
|
||||
};
|
||||
|
||||
Events.init = function () {
|
||||
@@ -137,7 +137,7 @@ define('forum/topic/events', [
|
||||
|
||||
var editData = {
|
||||
editor: data.editor,
|
||||
editedISO: utils.toISOString(data.post.edited)
|
||||
editedISO: utils.toISOString(data.post.edited),
|
||||
};
|
||||
|
||||
templates.parse('partials/topic/post-editor', editData, function (html) {
|
||||
|
||||
@@ -12,7 +12,7 @@ define('forum/topic/flag', [], function () {
|
||||
parseModal({
|
||||
pid: pid,
|
||||
username: username,
|
||||
userslug: userslug
|
||||
userslug: userslug,
|
||||
}, function (html) {
|
||||
flagModal = $(html);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ define('forum/topic/fork', ['components', 'postSelect'], function (components, p
|
||||
socket.emit('topics.createTopicFromPosts', {
|
||||
title: forkModal.find('#fork-title').val(),
|
||||
pids: postSelect.pids,
|
||||
fromTid: ajaxify.data.tid
|
||||
fromTid: ajaxify.data.tid,
|
||||
}, function (err, newTopic) {
|
||||
function fadeOutAndRemove(pid) {
|
||||
components.get('post', 'pid', pid).fadeOut(500, function () {
|
||||
@@ -63,7 +63,7 @@ define('forum/topic/fork', ['components', 'postSelect'], function (components, p
|
||||
type: 'success',
|
||||
clickfn: function () {
|
||||
ajaxify.go('topic/' + newTopic.slug);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
postSelect.pids.forEach(function (pid) {
|
||||
|
||||
@@ -109,7 +109,7 @@ define('forum/topic/move', function () {
|
||||
socket.emit(Move.moveAll ? 'topics.moveAll' : 'topics.move', {
|
||||
tids: Move.tids,
|
||||
cid: selectedEl.attr('data-cid'),
|
||||
currentCid: Move.currentCid
|
||||
currentCid: Move.currentCid,
|
||||
}, function (err) {
|
||||
modal.modal('hide');
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ define('forum/topic/postTools', [
|
||||
'components',
|
||||
'translator',
|
||||
'forum/topic/votes',
|
||||
'forum/topic/move-post'
|
||||
'forum/topic/move-post',
|
||||
], function (share, navigator, components, translator, votes, movePost) {
|
||||
|
||||
var PostTools = {};
|
||||
@@ -95,7 +95,7 @@ define('forum/topic/postTools', [
|
||||
translator.translate('[[topic:link_back, ' + ajaxify.data.titleRaw + ', ' + config.relative_path + '/topic/' + ajaxify.data.slug + ']]', function (body) {
|
||||
$(window).trigger('action:composer.topic.new', {
|
||||
cid: ajaxify.data.cid,
|
||||
body: body
|
||||
body: body,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -133,7 +133,7 @@ define('forum/topic/postTools', [
|
||||
|
||||
if (checkDuration(postEditDuration, timestamp, 'post-edit-duration-expired')) {
|
||||
$(window).trigger('action:composer.post.edit', {
|
||||
pid: getData(btn, 'data-pid')
|
||||
pid: getData(btn, 'data-pid'),
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -215,14 +215,14 @@ define('forum/topic/postTools', [
|
||||
topicName: ajaxify.data.titleRaw,
|
||||
username: username,
|
||||
text: selectedNode.text,
|
||||
selectedPid: selectedNode.pid
|
||||
selectedPid: selectedNode.pid,
|
||||
});
|
||||
} else {
|
||||
$(window).trigger('action:composer.post.new', {
|
||||
tid: tid,
|
||||
pid: toPid,
|
||||
topicName: ajaxify.data.titleRaw,
|
||||
text: username ? username + ' ' : ''
|
||||
text: username ? username + ' ' : '',
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -239,7 +239,7 @@ define('forum/topic/postTools', [
|
||||
pid: toPid,
|
||||
username: username,
|
||||
topicName: ajaxify.data.titleRaw,
|
||||
text: text
|
||||
text: text,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ define('forum/topic/postTools', [
|
||||
|
||||
socket.emit(method, {
|
||||
pid: pid,
|
||||
room_id: app.currentRoom
|
||||
room_id: app.currentRoom,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
app.alertError(err.message);
|
||||
@@ -350,7 +350,7 @@ define('forum/topic/postTools', [
|
||||
|
||||
socket.emit('posts.' + action, {
|
||||
pid: pid,
|
||||
tid: tid
|
||||
tid: tid,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
app.alertError(err.message);
|
||||
@@ -384,7 +384,7 @@ define('forum/topic/postTools', [
|
||||
callback: function () {
|
||||
staleReplyAnyway = true;
|
||||
callback();
|
||||
}
|
||||
},
|
||||
},
|
||||
create: {
|
||||
label: '[[topic:stale.create]]',
|
||||
@@ -393,12 +393,12 @@ define('forum/topic/postTools', [
|
||||
translator.translate('[[topic:link_back, ' + ajaxify.data.title + ', ' + config.relative_path + '/topic/' + ajaxify.data.slug + ']]', function (body) {
|
||||
$(window).trigger('action:composer.topic.new', {
|
||||
cid: ajaxify.data.cid,
|
||||
body: body
|
||||
body: body,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
warning.modal();
|
||||
|
||||
@@ -7,11 +7,11 @@ define('forum/topic/posts', [
|
||||
'forum/infinitescroll',
|
||||
'forum/topic/postTools',
|
||||
'navigator',
|
||||
'components'
|
||||
'components',
|
||||
], function (pagination, infinitescroll, postTools, navigator, components) {
|
||||
|
||||
var Posts = {
|
||||
_imageLoaderTimeout: undefined
|
||||
_imageLoaderTimeout: undefined,
|
||||
};
|
||||
|
||||
Posts.onNewPost = function (data) {
|
||||
@@ -235,7 +235,7 @@ define('forum/topic/posts', [
|
||||
tid: tid,
|
||||
after: after,
|
||||
direction: direction,
|
||||
topicPostSort: config.topicPostSort
|
||||
topicPostSort: config.topicPostSort,
|
||||
}, function (data, done) {
|
||||
indicatorEl.fadeOut();
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ define('forum/topic/replies', ['navigator', 'components', 'forum/topic/posts'],
|
||||
'downvote:disabled': ajaxify.data['downvote:disabled'],
|
||||
'reputation:disabled': ajaxify.data['reputation:disabled'],
|
||||
loggedIn: !!app.user.uid,
|
||||
hideReplies: true
|
||||
hideReplies: true,
|
||||
};
|
||||
app.parseAndTranslate('topic', 'posts', tplData, function (html) {
|
||||
$('<div>', {component: 'post/replies'}).html(html).hide().insertAfter(button).slideDown('fast');
|
||||
|
||||
@@ -7,7 +7,7 @@ define('forum/topic/threadTools', [
|
||||
'forum/topic/move',
|
||||
'forum/topic/delete-posts',
|
||||
'components',
|
||||
'translator'
|
||||
'translator',
|
||||
], function (fork, move, deletePosts, components, translator) {
|
||||
|
||||
var ThreadTools = {};
|
||||
@@ -101,7 +101,7 @@ define('forum/topic/threadTools', [
|
||||
alert_id: 'topic_follow',
|
||||
title: '[[global:please_log_in]]',
|
||||
message: '[[topic:login_to_subscribe]]',
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
}
|
||||
var message = '';
|
||||
@@ -118,7 +118,7 @@ define('forum/topic/threadTools', [
|
||||
alert_id: 'follow_thread',
|
||||
message: message,
|
||||
type: 'success',
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
$(window).trigger('action:topics.changeWatching', {tid: tid, type: type});
|
||||
|
||||
@@ -69,7 +69,7 @@ define('forum/topic/votes', ['components', 'translator'], function (components,
|
||||
|
||||
socket.emit(currentState ? 'posts.unvote' : method , {
|
||||
pid: post.attr('data-pid'),
|
||||
room_id: app.currentRoom
|
||||
room_id: app.currentRoom,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
if (err.message === 'self-vote') {
|
||||
@@ -100,7 +100,7 @@ define('forum/topic/votes', ['components', 'translator'], function (components,
|
||||
title: 'Voters',
|
||||
message: translated,
|
||||
className: 'vote-modal',
|
||||
show: true
|
||||
show: true,
|
||||
});
|
||||
|
||||
dialog.on('click', function () {
|
||||
|
||||
@@ -94,7 +94,7 @@ define('forum/unread', ['forum/recent', 'topicSelect', 'forum/infinitescroll', '
|
||||
infinitescroll.loadMore('topics.loadMoreUnreadTopics', {
|
||||
after: $('[component="category"]').attr('data-nextstart'),
|
||||
cid: cid,
|
||||
filter: ajaxify.data.selectedFilter.filter
|
||||
filter: ajaxify.data.selectedFilter.filter,
|
||||
}, function (data, done) {
|
||||
if (data.topics && data.topics.length) {
|
||||
recent.onTopicsLoaded('unread', data.topics, true, done);
|
||||
|
||||
@@ -52,7 +52,7 @@ define('forum/users', ['translator'], function (translator) {
|
||||
|
||||
var query = {
|
||||
section: activeSection,
|
||||
page: 1
|
||||
page: 1,
|
||||
};
|
||||
|
||||
if (!username) {
|
||||
|
||||
@@ -10,7 +10,7 @@ $('document').ready(function () {
|
||||
if ($('#database-error').length) {
|
||||
$('[name="database"]').parents('.input-row').addClass('error');
|
||||
$('html, body').animate({
|
||||
scrollTop: ($('#database-error').offset().top + 100) + 'px'
|
||||
scrollTop: ($('#database-error').offset().top + 100) + 'px',
|
||||
}, 400);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,15 +29,15 @@ define('autocomplete', function () {
|
||||
user: {
|
||||
uid: user.uid,
|
||||
name: user.username,
|
||||
slug: user.userslug
|
||||
}
|
||||
slug: user.userslug,
|
||||
},
|
||||
};
|
||||
});
|
||||
response(names);
|
||||
}
|
||||
$('.ui-autocomplete a').attr('data-ajaxify', 'false');
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -49,7 +49,7 @@ define('autocomplete', function () {
|
||||
select: onselect,
|
||||
source: function (request, response) {
|
||||
socket.emit('groups.search', {
|
||||
query: request.term
|
||||
query: request.term,
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -62,15 +62,15 @@ define('autocomplete', function () {
|
||||
value: group.name,
|
||||
group: {
|
||||
name: group.name,
|
||||
slug: group.slug
|
||||
}
|
||||
slug: group.slug,
|
||||
},
|
||||
};
|
||||
});
|
||||
response(names);
|
||||
}
|
||||
$('.ui-autocomplete a').attr('data-ajaxify', 'false');
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -95,7 +95,7 @@ define('autocomplete', function () {
|
||||
source: function (request, response) {
|
||||
socket.emit('topics.autocompleteTags', {
|
||||
query: request.term,
|
||||
cid: ajaxify.data.cid || 0
|
||||
cid: ajaxify.data.cid || 0,
|
||||
}, function (err, tags) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -105,7 +105,7 @@ define('autocomplete', function () {
|
||||
}
|
||||
$('.ui-autocomplete a').attr('data-ajaxify', 'false');
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ define('chat', [
|
||||
'forum/chats',
|
||||
'forum/chats/messages',
|
||||
'translator',
|
||||
'scrollStop'
|
||||
'scrollStop',
|
||||
], function (components, taskbar, S, sounds, Chats, ChatsMessages, translator, scrollStop) {
|
||||
|
||||
var module = {};
|
||||
@@ -72,7 +72,7 @@ define('chat', [
|
||||
taskbar.push('chat', modal.attr('UUID'), {
|
||||
title: username,
|
||||
touid: data.message.fromUser.uid,
|
||||
roomId: data.roomId
|
||||
roomId: data.roomId,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@@ -119,7 +119,7 @@ define('chat', [
|
||||
});
|
||||
|
||||
templates.parse('partials/chats/dropdown', {
|
||||
rooms: rooms
|
||||
rooms: rooms,
|
||||
}, function (html) {
|
||||
translator.translate(html, function (translated) {
|
||||
chatsListEl.empty().html(translated);
|
||||
@@ -175,7 +175,7 @@ define('chat', [
|
||||
chatModal.find('.modal-content').resizable({
|
||||
handles: 'n, e, s, w, se',
|
||||
minHeight: 250,
|
||||
minWidth: 400
|
||||
minWidth: 400,
|
||||
});
|
||||
|
||||
chatModal.find('.modal-content').on('resize', function (event, ui) {
|
||||
@@ -194,7 +194,7 @@ define('chat', [
|
||||
chatModal.find('#chat-message-input').focus();
|
||||
},
|
||||
distance: 10,
|
||||
handle: '.modal-header'
|
||||
handle: '.modal-header',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -264,7 +264,7 @@ define('chat', [
|
||||
title: data.roomName || (data.users.length ? data.users[0].username : ''),
|
||||
roomId: data.roomId,
|
||||
icon: 'fa-comment',
|
||||
state: ''
|
||||
state: '',
|
||||
});
|
||||
|
||||
$(window).trigger('action:chat.loaded', chatModal);
|
||||
|
||||
@@ -52,7 +52,7 @@ define('components', function () {
|
||||
},
|
||||
'chat/message/body': function (messageId) {
|
||||
return $('[component="chat/message"][data-mid="' + messageId + '"] [component="chat/message/body"]');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
components.get = function () {
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
/* globals define, app */
|
||||
|
||||
define('coverPhoto', [
|
||||
'vendor/jquery/draggable-background/backgroundDraggable'
|
||||
'vendor/jquery/draggable-background/backgroundDraggable',
|
||||
], function () {
|
||||
|
||||
var coverPhoto = {
|
||||
coverEl: null,
|
||||
saveFn: null
|
||||
saveFn: null,
|
||||
};
|
||||
|
||||
coverPhoto.init = function (coverEl, saveFn, uploadFn, removeFn) {
|
||||
@@ -56,14 +56,14 @@ define('coverPhoto', [
|
||||
coverEl.toggleClass('active', 1)
|
||||
.backgroundDraggable({
|
||||
axis: 'y',
|
||||
units: 'percent'
|
||||
units: 'percent',
|
||||
});
|
||||
|
||||
app.alert({
|
||||
alert_id: 'drag_start',
|
||||
title: '[[modules:cover.dragging_title]]',
|
||||
message: '[[modules:cover.dragging_message]]',
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
if (privileges.hasOwnProperty(priv)) {
|
||||
states.push({
|
||||
name: priv,
|
||||
state: privileges[priv]
|
||||
state: privileges[priv],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -285,5 +285,5 @@
|
||||
}(
|
||||
typeof exports === 'object' ? exports :
|
||||
typeof define === 'function' && define.amd ? {} :
|
||||
helpers = {}
|
||||
helpers = {},
|
||||
));
|
||||
|
||||
@@ -40,7 +40,7 @@ define('iconSelect', function () {
|
||||
el.attr('value', '');
|
||||
|
||||
onModified(el);
|
||||
}
|
||||
},
|
||||
},
|
||||
success: {
|
||||
label: 'Select',
|
||||
@@ -56,9 +56,9 @@ define('iconSelect', function () {
|
||||
}
|
||||
|
||||
onModified(el);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
picker.on('show.bs.modal', function () {
|
||||
|
||||
@@ -173,13 +173,13 @@ define('navigator', ['forum/pagination', 'components'], function (pagination, co
|
||||
|
||||
navigator.scrollUp = function () {
|
||||
$('body,html').animate({
|
||||
scrollTop: $(window).scrollTop() - $(window).height()
|
||||
scrollTop: $(window).scrollTop() - $(window).height(),
|
||||
});
|
||||
};
|
||||
|
||||
navigator.scrollDown = function () {
|
||||
$('body,html').animate({
|
||||
scrollTop: $(window).scrollTop() + $(window).height()
|
||||
scrollTop: $(window).scrollTop() + $(window).height(),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -266,7 +266,7 @@ define('navigator', ['forum/pagination', 'components'], function (pagination, co
|
||||
}
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: scrollTop + 'px'
|
||||
scrollTop: scrollTop + 'px',
|
||||
}, duration, function () {
|
||||
if (done) {
|
||||
// Re-enable onScroll behaviour
|
||||
|
||||
@@ -71,7 +71,7 @@ define('notifications', ['sounds', 'translator', 'components'], function (sound,
|
||||
var payload = {
|
||||
alert_id: 'new_notif',
|
||||
title: '[[notifications:new_notification]]',
|
||||
timeout: 2000
|
||||
timeout: 2000,
|
||||
};
|
||||
|
||||
if (notifData.path) {
|
||||
@@ -151,7 +151,7 @@ define('notifications', ['sounds', 'translator', 'components'], function (sound,
|
||||
|
||||
var payload = {
|
||||
count: count,
|
||||
updateFavicon: true
|
||||
updateFavicon: true,
|
||||
};
|
||||
$(window).trigger('action:notification.updateCount', payload);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
|
||||
title: data.title || '[[global:upload_file]]',
|
||||
description: data.description || '',
|
||||
button: data.button || '[[global:upload]]',
|
||||
accept: data.accept ? data.accept.replace(/,/g, ', ') : ''
|
||||
accept: data.accept ? data.accept.replace(/,/g, ', ') : '',
|
||||
}, function (uploadModal) {
|
||||
uploadModal = $(uploadModal);
|
||||
|
||||
@@ -92,10 +92,10 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
|
||||
autoCropArea: 1,
|
||||
ready: function () {
|
||||
cropperModal.find('.crop-btn').trigger('click');
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -131,7 +131,7 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
|
||||
socketMethod: data.socketMethod,
|
||||
aspectRatio: data.aspectRatio,
|
||||
paramName: data.paramName,
|
||||
paramValue: data.paramValue
|
||||
paramValue: data.paramValue,
|
||||
}, callback);
|
||||
}, false);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
define('search', ['navigator', 'translator'], function (nav, translator) {
|
||||
|
||||
var Search = {
|
||||
current: {}
|
||||
current: {},
|
||||
};
|
||||
|
||||
Search.query = function (data, callback) {
|
||||
@@ -39,7 +39,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
|
||||
var postedBy = data.by || '';
|
||||
var query = {
|
||||
term: data.term,
|
||||
'in': searchIn
|
||||
'in': searchIn,
|
||||
};
|
||||
|
||||
if (postedBy && (searchIn === 'posts' || searchIn === 'titles' || searchIn === 'titlesposts')) {
|
||||
@@ -89,7 +89,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
|
||||
Search.queryTopic = function (tid, term, callback) {
|
||||
socket.emit('topics.search', {
|
||||
tid: tid,
|
||||
term: term
|
||||
term: term,
|
||||
}, function (err, pids) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
@@ -102,7 +102,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
|
||||
return a - b;
|
||||
}),
|
||||
tid: tid,
|
||||
term: term
|
||||
term: term,
|
||||
};
|
||||
|
||||
Search.checkPagePresence(tid, function () {
|
||||
@@ -121,7 +121,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
|
||||
};
|
||||
|
||||
Search.topicDOM = {
|
||||
active: false
|
||||
active: false,
|
||||
};
|
||||
|
||||
Search.topicDOM.prev = function () {
|
||||
@@ -144,7 +144,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
|
||||
var data = {
|
||||
pid: Search.current.results[index],
|
||||
tid: Search.current.tid,
|
||||
topicPostSort: config.topicPostSort
|
||||
topicPostSort: config.topicPostSort,
|
||||
};
|
||||
socket.emit('posts.getPidIndex', data, function (err, postIndex) {
|
||||
if (err) {
|
||||
|
||||
@@ -10,7 +10,7 @@ define('settings', function () {
|
||||
'settings/select',
|
||||
'settings/array',
|
||||
'settings/key',
|
||||
'settings/object'
|
||||
'settings/object',
|
||||
];
|
||||
|
||||
var Settings,
|
||||
@@ -284,7 +284,7 @@ define('settings', function () {
|
||||
}
|
||||
socket.emit('admin.settings.set', {
|
||||
hash: hash,
|
||||
values: settings
|
||||
values: settings,
|
||||
}, function (err) {
|
||||
if (notify) {
|
||||
if (err) {
|
||||
@@ -292,14 +292,14 @@ define('settings', function () {
|
||||
title: 'Settings Not Saved',
|
||||
type: 'danger',
|
||||
message: "NodeBB failed to save the settings.",
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
} else {
|
||||
app.alert({
|
||||
title: 'Settings Saved',
|
||||
type: 'success',
|
||||
message: "Settings have been successfully saved",
|
||||
timeout: 2500
|
||||
timeout: 2500,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ define('settings', function () {
|
||||
settings._ = JSON.parse(settings._);
|
||||
} catch (_error) {}
|
||||
Settings.cfg = settings;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ define('settings', function () {
|
||||
*/
|
||||
sync: function (hash, wrapper, callback) {
|
||||
socket.emit('admin.settings.get', {
|
||||
hash: hash
|
||||
hash: hash,
|
||||
}, function (err, values) {
|
||||
if (err) {
|
||||
if (typeof callback === 'function') {
|
||||
@@ -442,7 +442,7 @@ define('settings', function () {
|
||||
title: 'Attributes Not Saved',
|
||||
message: "'" + (notSaved.join(', ')) + "' could not be saved. Please contact the plugin-author!",
|
||||
type: 'danger',
|
||||
timeout: 5000
|
||||
timeout: 5000,
|
||||
});
|
||||
}
|
||||
helper.persistSettings(hash, Settings.cfg, notify, callback);
|
||||
@@ -450,7 +450,7 @@ define('settings', function () {
|
||||
load: function (hash, formEl, callback) {
|
||||
callback = callback || function () {};
|
||||
socket.emit('admin.settings.get', {
|
||||
hash: hash
|
||||
hash: hash,
|
||||
}, function (err, values) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
@@ -502,7 +502,7 @@ define('settings', function () {
|
||||
|
||||
socket.emit('admin.settings.set', {
|
||||
hash: hash,
|
||||
values: values
|
||||
values: values,
|
||||
}, function (err) {
|
||||
// Remove unsaved flag to re-enable ajaxify
|
||||
app.flags._unsaved = false;
|
||||
@@ -514,19 +514,19 @@ define('settings', function () {
|
||||
app.alert({
|
||||
title: 'Error while saving settings',
|
||||
type: 'error',
|
||||
timeout: 2500
|
||||
timeout: 2500,
|
||||
});
|
||||
} else {
|
||||
app.alert({
|
||||
title: 'Settings Saved',
|
||||
type: 'success',
|
||||
timeout: 2500
|
||||
timeout: 2500,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ define('settings/array', function () {
|
||||
function createRemoveButton(elements) {
|
||||
var rm = $(helper.createElement('button', {
|
||||
"class": 'btn btn-xs btn-primary remove',
|
||||
title: 'Remove Item'
|
||||
title: 'Remove Item',
|
||||
}, '-'));
|
||||
rm.click(function (event) {
|
||||
event.preventDefault();
|
||||
@@ -76,7 +76,7 @@ define('settings/array', function () {
|
||||
newValue = element.data('new') || '',
|
||||
add = $(helper.createElement('button', {
|
||||
"class": 'btn btn-sm btn-primary add',
|
||||
title: 'Expand Array'
|
||||
title: 'Expand Array',
|
||||
}, '+'));
|
||||
add.click(function (event) {
|
||||
event.preventDefault();
|
||||
@@ -139,7 +139,7 @@ define('settings/array', function () {
|
||||
} else {
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return SettingsArray;
|
||||
|
||||
@@ -10,7 +10,7 @@ define('settings/checkbox', function () {
|
||||
},
|
||||
create: function () {
|
||||
return Settings.helper.createElement('input', {
|
||||
type: 'checkbox'
|
||||
type: 'checkbox',
|
||||
});
|
||||
},
|
||||
set: function (element, value) {
|
||||
@@ -29,7 +29,7 @@ define('settings/checkbox', function () {
|
||||
return value ? 1 : 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return SettingsCheckbox;
|
||||
|
||||
@@ -24,7 +24,7 @@ define('settings/key', function () {
|
||||
191: '/',
|
||||
219: '[',
|
||||
220: '\\',
|
||||
221: ']'
|
||||
221: ']',
|
||||
});
|
||||
|
||||
function Key() {
|
||||
@@ -213,7 +213,7 @@ define('settings/key', function () {
|
||||
} else {
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return SettingsKey;
|
||||
|
||||
@@ -8,7 +8,7 @@ define('settings/number', function () {
|
||||
return value ? +value : void 0;
|
||||
}
|
||||
return value ? +value : 0;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
@@ -108,7 +108,7 @@ define('settings/object', function () {
|
||||
} else {
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return SettingsObject;
|
||||
|
||||
@@ -41,7 +41,7 @@ define('settings/select', function () {
|
||||
} else {
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return SettingsSelect;
|
||||
|
||||
@@ -27,7 +27,7 @@ define('settings/textarea', function () {
|
||||
} else {
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return SettingsArea;
|
||||
|
||||
@@ -50,7 +50,7 @@ define('taskbar', function () {
|
||||
module: module,
|
||||
uuid: uuid,
|
||||
options: options,
|
||||
element: element
|
||||
element: element,
|
||||
};
|
||||
|
||||
$(window).trigger('filter:taskbar.push', data);
|
||||
@@ -119,7 +119,7 @@ define('taskbar', function () {
|
||||
'</a>')
|
||||
.attr({
|
||||
'data-module': data.module,
|
||||
'data-uuid': data.uuid
|
||||
'data-uuid': data.uuid,
|
||||
})
|
||||
.addClass(data.options.state !== undefined ? data.options.state : 'active');
|
||||
|
||||
|
||||
@@ -532,7 +532,7 @@
|
||||
jQuery('html').css('direction', value).attr('data-dir', value);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return adaptor;
|
||||
|
||||
@@ -11,7 +11,7 @@ define('uploader', ['translator'], function (translator) {
|
||||
module.show({
|
||||
route: route,
|
||||
params: params,
|
||||
fileSize: fileSize
|
||||
fileSize: fileSize,
|
||||
}, callback);
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ define('uploader', ['translator'], function (translator) {
|
||||
title: data.title || '[[global:upload_file]]',
|
||||
description: data.description || '',
|
||||
button: data.button || '[[global:upload]]',
|
||||
accept: data.accept ? data.accept.replace(/,/g, ', ') : ''
|
||||
accept: data.accept ? data.accept.replace(/,/g, ', ') : '',
|
||||
}, function (uploadModal) {
|
||||
uploadModal = $(uploadModal);
|
||||
|
||||
@@ -76,7 +76,7 @@ define('uploader', ['translator'], function (translator) {
|
||||
|
||||
uploadModal.find('#uploadForm').ajaxSubmit({
|
||||
headers: {
|
||||
'x-csrf-token': config.csrf_token
|
||||
'x-csrf-token': config.csrf_token,
|
||||
},
|
||||
error: function (xhr) {
|
||||
xhr = maybeParse(xhr);
|
||||
@@ -99,7 +99,7 @@ define('uploader', ['translator'], function (translator) {
|
||||
module.hideAlerts(uploadModal);
|
||||
uploadModal.modal('hide');
|
||||
}, 750);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user