1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 17:25:16 +03:00

Presets: support Marked description layout

This commit is contained in:
Ivan Efimov 2022-02-28 23:54:21 -06:00
parent 989816a2e1
commit 35d7cb699c
9 changed files with 82 additions and 10 deletions

View file

@ -500,7 +500,6 @@ GuiControl.prototype.saveToTextFileDialog = function(textToSave, suggestedFileNa
});
};
GuiControl.prototype._saveToTextFileDialogFileSelected = function(entry, textToSave, resolve, reject) {
checkChromeRuntimeError();
@ -533,7 +532,6 @@ GuiControl.prototype._saveToTextFileDialogFileSelected = function(entry, textToS
});
};
GuiControl.prototype.readTextFileDialog = function(extension) {
const accepts = [{ description: `${extension.toUpperCase()} files`, extensions: [extension] }];
@ -560,7 +558,6 @@ GuiControl.prototype.readTextFileDialog = function(extension) {
});
};
GuiControl.prototype.escapeHtml = function(unsafe) {
return unsafe
.replace(/&/g, "&")
@ -570,5 +567,11 @@ GuiControl.prototype.escapeHtml = function(unsafe) {
.replace(/'/g, "'");
};
GuiControl.prototype.addLinksTargetBlank = function(element) {
element.find('a').each(function() {
$(this).attr('target', '_blank');
});
};
// initialize object into GUI variable
window.GUI = new GuiControl();

View file

@ -84,10 +84,9 @@ firmware_flasher.initialize = function (callback) {
let formattedNotes = summary.notes.replace(/#(\d+)/g, '[#$1](https://github.com/betaflight/betaflight/pull/$1)');
formattedNotes = marked.parse(formattedNotes);
formattedNotes = DOMPurify.sanitize(formattedNotes);
$('div.release_info .notes').html(formattedNotes);
$('div.release_info .notes').find('a').each(function() {
$(this).attr('target', '_blank');
});
GUI.addLinksTargetBlank($('div.release_info .notes'));
if (self.releases) {
$('div.release_info').slideDown();