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() {
|
||||
console.log('[admin] Restarting NodeBB...');
|
||||
socket.emit('admin.restart');
|
||||
});
|
||||
|
||||
|
||||
@@ -253,8 +253,6 @@ $(document).ready(function() {
|
||||
};
|
||||
|
||||
function ajaxifyAnchors() {
|
||||
templates.registerLoader(ajaxify.loadTemplate);
|
||||
|
||||
function hrefEmpty(href) {
|
||||
return href === undefined || href === '' || href === 'javascript:;';
|
||||
}
|
||||
@@ -298,6 +296,8 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
|
||||
templates.registerLoader(ajaxify.loadTemplate);
|
||||
|
||||
if (window.history && window.history.pushState) {
|
||||
// Progressive Enhancement, ajaxify available only to modern browsers
|
||||
ajaxifyAnchors();
|
||||
|
||||
@@ -92,7 +92,7 @@ app.cacheBuster = null;
|
||||
|
||||
switch(url_parts[0]) {
|
||||
case 'user':
|
||||
room = 'user/' + ajaxify.data.theirid;
|
||||
room = 'user/' + ajaxify.data ? ajaxify.data.theirid : 0;
|
||||
break;
|
||||
case 'topic':
|
||||
room = 'topic_' + url_parts[1];
|
||||
|
||||
@@ -294,7 +294,6 @@ define('settings', function () {
|
||||
message: "NodeBB failed to save the settings.",
|
||||
timeout: 5000
|
||||
});
|
||||
console.log('[settings] Unable to set settings for hash: ', hash);
|
||||
} else {
|
||||
app.alert({
|
||||
title: 'Settings Saved',
|
||||
@@ -387,7 +386,6 @@ define('settings', function () {
|
||||
hash: hash
|
||||
}, function (err, values) {
|
||||
if (err) {
|
||||
console.log('[settings] Unable to load settings for hash: ', hash);
|
||||
if (typeof callback === 'function') {
|
||||
callback(err);
|
||||
}
|
||||
@@ -455,7 +453,6 @@ define('settings', function () {
|
||||
hash: hash
|
||||
}, function (err, values) {
|
||||
if (err) {
|
||||
console.log('[settings] Unable to load settings for hash: ', hash);
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
@@ -508,8 +505,6 @@ define('settings', function () {
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('[settings] Form not found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
/* global define, socket, config */
|
||||
/* global app, define, socket, config */
|
||||
|
||||
define('sounds', ['buzz'], function(buzz) {
|
||||
var Sounds = {};
|
||||
@@ -17,7 +17,7 @@ define('sounds', ['buzz'], function(buzz) {
|
||||
function loadFiles() {
|
||||
socket.emit('modules.sounds.getSounds', function(err, sounds) {
|
||||
if (err) {
|
||||
return console.log('[sounds] Could not initialise!');
|
||||
return app.alertError('[sounds] Could not initialise!');
|
||||
}
|
||||
|
||||
files = sounds;
|
||||
@@ -27,7 +27,7 @@ define('sounds', ['buzz'], function(buzz) {
|
||||
function loadMapping() {
|
||||
socket.emit('modules.sounds.getMapping', function(err, mapping) {
|
||||
if (err) {
|
||||
return console.log('[sounds] Could not load sound mapping!');
|
||||
return app.alertError('[sounds] Could not load sound mapping!');
|
||||
}
|
||||
eventSoundMapping = mapping;
|
||||
});
|
||||
@@ -65,7 +65,7 @@ define('sounds', ['buzz'], function(buzz) {
|
||||
if (loadedSounds[fileName]) {
|
||||
loadedSounds[fileName].play();
|
||||
} 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
|
||||
window.translator = {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
ajaxify.variables = {};
|
||||
|
||||
ajaxify.variables.set = function(key, value) {
|
||||
if (console && console.warn) {
|
||||
console.warn('[deprecated] variables.set is deprecated, please use ajaxify.data, key=' + key);
|
||||
}
|
||||
if (typeof console !== 'undefined' && console.warn) {
|
||||
console.warn('[deprecated] variables.set is deprecated, please use ajaxify.data, key=' + key);
|
||||
}
|
||||
parsedVariables[key] = value;
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
return parsedVariables[key];
|
||||
|
||||
Reference in New Issue
Block a user