mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
This commit is contained in:
@@ -74,7 +74,6 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
Mousetrap.bind('ctrl+shift+a R', function() {
|
Mousetrap.bind('ctrl+shift+a R', function() {
|
||||||
console.log('[admin] Restarting NodeBB...');
|
|
||||||
socket.emit('admin.restart');
|
socket.emit('admin.restart');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -196,9 +195,9 @@
|
|||||||
|
|
||||||
if (checked) {
|
if (checked) {
|
||||||
checkbox.after('<i class="fa fa-toggle-on"></i>');
|
checkbox.after('<i class="fa fa-toggle-on"></i>');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
checkbox.after('<i class="fa fa-toggle-off"></i>');
|
checkbox.after('<i class="fa fa-toggle-off"></i>');
|
||||||
}
|
}
|
||||||
|
|
||||||
checkbox.attr('data-toggle-added', true);
|
checkbox.attr('data-toggle-added', true);
|
||||||
|
|||||||
@@ -253,8 +253,6 @@ $(document).ready(function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function ajaxifyAnchors() {
|
function ajaxifyAnchors() {
|
||||||
templates.registerLoader(ajaxify.loadTemplate);
|
|
||||||
|
|
||||||
function hrefEmpty(href) {
|
function hrefEmpty(href) {
|
||||||
return href === undefined || href === '' || href === 'javascript:;';
|
return href === undefined || href === '' || href === 'javascript:;';
|
||||||
}
|
}
|
||||||
@@ -298,6 +296,8 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
templates.registerLoader(ajaxify.loadTemplate);
|
||||||
|
|
||||||
if (window.history && window.history.pushState) {
|
if (window.history && window.history.pushState) {
|
||||||
// Progressive Enhancement, ajaxify available only to modern browsers
|
// Progressive Enhancement, ajaxify available only to modern browsers
|
||||||
ajaxifyAnchors();
|
ajaxifyAnchors();
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ app.cacheBuster = null;
|
|||||||
|
|
||||||
switch(url_parts[0]) {
|
switch(url_parts[0]) {
|
||||||
case 'user':
|
case 'user':
|
||||||
room = 'user/' + ajaxify.data.theirid;
|
room = 'user/' + ajaxify.data ? ajaxify.data.theirid : 0;
|
||||||
break;
|
break;
|
||||||
case 'topic':
|
case 'topic':
|
||||||
room = 'topic_' + url_parts[1];
|
room = 'topic_' + url_parts[1];
|
||||||
|
|||||||
@@ -294,7 +294,6 @@ define('settings', function () {
|
|||||||
message: "NodeBB failed to save the settings.",
|
message: "NodeBB failed to save the settings.",
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
});
|
});
|
||||||
console.log('[settings] Unable to set settings for hash: ', hash);
|
|
||||||
} else {
|
} else {
|
||||||
app.alert({
|
app.alert({
|
||||||
title: 'Settings Saved',
|
title: 'Settings Saved',
|
||||||
@@ -387,7 +386,6 @@ define('settings', function () {
|
|||||||
hash: hash
|
hash: hash
|
||||||
}, function (err, values) {
|
}, function (err, values) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('[settings] Unable to load settings for hash: ', hash);
|
|
||||||
if (typeof callback === 'function') {
|
if (typeof callback === 'function') {
|
||||||
callback(err);
|
callback(err);
|
||||||
}
|
}
|
||||||
@@ -455,10 +453,9 @@ define('settings', function () {
|
|||||||
hash: hash
|
hash: hash
|
||||||
}, function (err, values) {
|
}, function (err, values) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('[settings] Unable to load settings for hash: ', hash);
|
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse all values. If they are json, return json
|
// Parse all values. If they are json, return json
|
||||||
for(var key in values) {
|
for(var key in values) {
|
||||||
if (values.hasOwnProperty(key)) {
|
if (values.hasOwnProperty(key)) {
|
||||||
@@ -508,8 +505,6 @@ define('settings', function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
console.log('[settings] Form not found.');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/* global define, socket, config */
|
/* global app, define, socket, config */
|
||||||
|
|
||||||
define('sounds', ['buzz'], function(buzz) {
|
define('sounds', ['buzz'], function(buzz) {
|
||||||
var Sounds = {};
|
var Sounds = {};
|
||||||
@@ -17,7 +17,7 @@ define('sounds', ['buzz'], function(buzz) {
|
|||||||
function loadFiles() {
|
function loadFiles() {
|
||||||
socket.emit('modules.sounds.getSounds', function(err, sounds) {
|
socket.emit('modules.sounds.getSounds', function(err, sounds) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return console.log('[sounds] Could not initialise!');
|
return app.alertError('[sounds] Could not initialise!');
|
||||||
}
|
}
|
||||||
|
|
||||||
files = sounds;
|
files = sounds;
|
||||||
@@ -27,7 +27,7 @@ define('sounds', ['buzz'], function(buzz) {
|
|||||||
function loadMapping() {
|
function loadMapping() {
|
||||||
socket.emit('modules.sounds.getMapping', function(err, mapping) {
|
socket.emit('modules.sounds.getMapping', function(err, mapping) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return console.log('[sounds] Could not load sound mapping!');
|
return app.alertError('[sounds] Could not load sound mapping!');
|
||||||
}
|
}
|
||||||
eventSoundMapping = mapping;
|
eventSoundMapping = mapping;
|
||||||
});
|
});
|
||||||
@@ -65,7 +65,7 @@ define('sounds', ['buzz'], function(buzz) {
|
|||||||
if (loadedSounds[fileName]) {
|
if (loadedSounds[fileName]) {
|
||||||
loadedSounds[fileName].play();
|
loadedSounds[fileName].play();
|
||||||
} else {
|
} else {
|
||||||
console.log('[sounds] Not found:', fileName);
|
app.alertError('[sounds] Not found: ' + fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -302,7 +302,9 @@
|
|||||||
// Expose a global `translator` object for backwards compatibility
|
// Expose a global `translator` object for backwards compatibility
|
||||||
window.translator = {
|
window.translator = {
|
||||||
translate: function() {
|
translate: function() {
|
||||||
console.warn('[translator] Global invocation of the translator is now deprecated, please `require` the module instead.');
|
if (typeof console !== 'undefined' && console.warn) {
|
||||||
|
console.warn('[translator] Global invocation of the translator is now deprecated, please `require` the module instead.');
|
||||||
|
}
|
||||||
_translator.translate.apply(_translator, arguments);
|
_translator.translate.apply(_translator, arguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
ajaxify.variables = {};
|
ajaxify.variables = {};
|
||||||
|
|
||||||
ajaxify.variables.set = function(key, value) {
|
ajaxify.variables.set = function(key, value) {
|
||||||
if (console && console.warn) {
|
if (typeof console !== 'undefined' && console.warn) {
|
||||||
console.warn('[deprecated] variables.set is deprecated, please use ajaxify.data, key=' + key);
|
console.warn('[deprecated] variables.set is deprecated, please use ajaxify.data, key=' + key);
|
||||||
}
|
}
|
||||||
parsedVariables[key] = value;
|
parsedVariables[key] = value;
|
||||||
};
|
};
|
||||||
|
|
||||||
ajaxify.variables.get = function(key) {
|
ajaxify.variables.get = function(key) {
|
||||||
if (console && console.warn) {
|
if (typeof console !== 'undefined' && console.warn) {
|
||||||
console.warn('[deprecated] variables.get is deprecated, please use ajaxify.data, key=' + key);
|
console.warn('[deprecated] variables.get is deprecated, please use ajaxify.data, key=' + key);
|
||||||
}
|
}
|
||||||
return parsedVariables[key];
|
return parsedVariables[key];
|
||||||
|
|||||||
Reference in New Issue
Block a user