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