mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
closes #5704
This commit is contained in:
@@ -5,5 +5,8 @@
|
||||
|
||||
"custom-header": "Custom Header",
|
||||
"custom-header.description": "Enter custom HTML here (ex. JavaScript, Meta Tags, etc.), which will be appended to the <code><head></code> section of your forum's markup.",
|
||||
"custom-header.enable": "Enable Custom Header"
|
||||
"custom-header.enable": "Enable Custom Header",
|
||||
|
||||
"custom-css.livereload": "Enable Live Reload",
|
||||
"custom-css.livereload.description": "Enable this to force all sessions on every device under your account to refresh whenever you click save"
|
||||
}
|
||||
@@ -28,6 +28,12 @@ define('admin/appearance/customise', ['admin/settings', 'ace/ace'], function (Se
|
||||
app.flags._unsaved = true;
|
||||
$('#customHTML-holder').val(customHTML.getValue());
|
||||
});
|
||||
|
||||
$('#save').on('click', function () {
|
||||
if ($('#enableLiveReload').is(':checked')) {
|
||||
socket.emit('admin.reloadAllSessions');
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -72,6 +72,11 @@ app.cacheBuster = null;
|
||||
});
|
||||
}
|
||||
});
|
||||
socket.on('event:livereload', function (data) {
|
||||
if (app.user.isAdmin && !ajaxify.currentPage.match(/admin/)) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
require(['taskbar', 'helpers', 'forum/pagination'], function (taskbar, helpers, pagination) {
|
||||
taskbar.init();
|
||||
|
||||
@@ -13,6 +13,7 @@ var events = require('../events');
|
||||
var emailer = require('../emailer');
|
||||
var db = require('../database');
|
||||
var analytics = require('../analytics');
|
||||
var websockets = require('../socket.io/index');
|
||||
var index = require('./index');
|
||||
var getAdminSearchDict = require('../admin/search').getDictionary;
|
||||
|
||||
@@ -278,5 +279,9 @@ SocketAdmin.deleteAllSessions = function (socket, data, callback) {
|
||||
user.auth.deleteAllSessions(callback);
|
||||
};
|
||||
|
||||
SocketAdmin.reloadAllSessions = function (socket, data, callback) {
|
||||
websockets.in('uid_' + socket.uid).emit('event:livereload');
|
||||
callback();
|
||||
};
|
||||
|
||||
module.exports = SocketAdmin;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="custom-header">
|
||||
<p>
|
||||
[[admin/appearance/customise:custom-header.description]]
|
||||
@@ -40,6 +41,18 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form class="form">
|
||||
<div class="form-group">
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="enableLiveReload">
|
||||
<input class="mdl-switch__input" id="enableLiveReload" type="checkbox" data-field="enableLiveReload" checked />
|
||||
<span class="mdl-switch__label">
|
||||
[[admin/appearance/customise:custom-css.livereload]]
|
||||
<small>[[admin/appearance/customise:custom-css.livereload.description]]</small>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user