mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 15:17:02 +02:00
Split up customJS into customHTML and customJS for better organisation (#5981)
* WIP * fixed customJS not actually working in footer * Moving scripts to footer, #5980 * Added upgrade scripts for #5980
This commit is contained in:
@@ -6,9 +6,11 @@ define('admin/appearance/customise', ['admin/settings', 'ace/ace'], function (Se
|
||||
Customise.init = function () {
|
||||
Settings.prepare(function () {
|
||||
$('#customCSS').text($('#customCSS-holder').val());
|
||||
$('#customJS').text($('#customJS-holder').val());
|
||||
$('#customHTML').text($('#customHTML-holder').val());
|
||||
|
||||
var customCSS = ace.edit('customCSS');
|
||||
var customJS = ace.edit('customJS');
|
||||
var customHTML = ace.edit('customHTML');
|
||||
|
||||
customCSS.setTheme('ace/theme/twilight');
|
||||
@@ -20,6 +22,15 @@ define('admin/appearance/customise', ['admin/settings', 'ace/ace'], function (Se
|
||||
$('#customCSS-holder').val(customCSS.getValue());
|
||||
});
|
||||
|
||||
customJS.setTheme('ace/theme/twilight');
|
||||
customJS.getSession().setMode('ace/mode/js');
|
||||
|
||||
customJS.on('change', function () {
|
||||
app.flags = app.flags || {};
|
||||
app.flags._unsaved = true;
|
||||
$('#customJS-holder').val(customJS.getValue());
|
||||
});
|
||||
|
||||
customHTML.setTheme('ace/theme/twilight');
|
||||
customHTML.getSession().setMode('ace/mode/html');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user