mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
lint: Run eslint --fix
on src/
This commit is contained in:
parent
b8d07a42eb
commit
8e5fd19db2
109 changed files with 9061 additions and 10572 deletions
|
@ -1,54 +1,54 @@
|
|||
// Specific hash to display the skin variants builder popup
|
||||
if (window.location.hash.toLowerCase() == "#skinvariantsbuilder") {
|
||||
if (window.location.hash.toLowerCase() == '#skinvariantsbuilder') {
|
||||
$('#skin-variants').addClass('popup-show');
|
||||
|
||||
$('.skin-variant').change(function() {
|
||||
$('.skin-variant').change(() => {
|
||||
updateSkinVariantsClasses();
|
||||
});
|
||||
|
||||
var containers = ['editor', 'background', 'toolbar'];
|
||||
var colors = ['super-light', 'light', 'dark', 'super-dark'];
|
||||
const containers = ['editor', 'background', 'toolbar'];
|
||||
const colors = ['super-light', 'light', 'dark', 'super-dark'];
|
||||
|
||||
updateCheckboxFromSkinClasses();
|
||||
updateSkinVariantsClasses();
|
||||
|
||||
// add corresponding classes when config change
|
||||
function updateSkinVariantsClasses() {
|
||||
var domsToUpdate = [
|
||||
const domsToUpdate = [
|
||||
$('html'),
|
||||
$('iframe[name=ace_outer]').contents().find('html'),
|
||||
$('iframe[name=ace_outer]').contents().find('iframe[name=ace_inner]').contents().find('html')
|
||||
$('iframe[name=ace_outer]').contents().find('iframe[name=ace_inner]').contents().find('html'),
|
||||
];
|
||||
colors.forEach(function(color) {
|
||||
containers.forEach(function(container) {
|
||||
domsToUpdate.forEach(function(el) { el.removeClass(color + '-' + container); });
|
||||
})
|
||||
})
|
||||
colors.forEach((color) => {
|
||||
containers.forEach((container) => {
|
||||
domsToUpdate.forEach((el) => { el.removeClass(`${color}-${container}`); });
|
||||
});
|
||||
});
|
||||
|
||||
domsToUpdate.forEach(function(el) { el.removeClass('full-width-editor'); });
|
||||
domsToUpdate.forEach((el) => { el.removeClass('full-width-editor'); });
|
||||
|
||||
var new_classes = [];
|
||||
$('select.skin-variant-color').each(function() {
|
||||
new_classes.push($(this).val() + "-" + $(this).data('container'));
|
||||
})
|
||||
if ($('#skin-variant-full-width').is(':checked')) new_classes.push("full-width-editor");
|
||||
const new_classes = [];
|
||||
$('select.skin-variant-color').each(function () {
|
||||
new_classes.push(`${$(this).val()}-${$(this).data('container')}`);
|
||||
});
|
||||
if ($('#skin-variant-full-width').is(':checked')) new_classes.push('full-width-editor');
|
||||
|
||||
domsToUpdate.forEach(function(el) { el.addClass(new_classes.join(" ")); });
|
||||
domsToUpdate.forEach((el) => { el.addClass(new_classes.join(' ')); });
|
||||
|
||||
$('#skin-variants-result').val('"skinVariants": "' + new_classes.join(" ") + '",');
|
||||
$('#skin-variants-result').val(`"skinVariants": "${new_classes.join(' ')}",`);
|
||||
}
|
||||
|
||||
// run on init
|
||||
function updateCheckboxFromSkinClasses() {
|
||||
$('html').attr('class').split(' ').forEach(function(classItem) {
|
||||
$('html').attr('class').split(' ').forEach((classItem) => {
|
||||
var container = classItem.split('-').slice(-1);
|
||||
|
||||
var container = classItem.substring(classItem.lastIndexOf("-") + 1, classItem.length);
|
||||
var container = classItem.substring(classItem.lastIndexOf('-') + 1, classItem.length);
|
||||
if (containers.indexOf(container) > -1) {
|
||||
var color = classItem.substring(0, classItem.lastIndexOf("-"));
|
||||
$('.skin-variant-color[data-container="' + container + '"').val(color);
|
||||
const color = classItem.substring(0, classItem.lastIndexOf('-'));
|
||||
$(`.skin-variant-color[data-container="${container}"`).val(color);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('#skin-variant-full-width').prop('checked', $('html').hasClass('full-width-editor'));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue