Drop pagedown-bootstrap library and all its related code

This commit is contained in:
Julia Casamitjana
2024-04-11 10:42:41 +02:00
committed by Dominic Sauer
parent 9fe18f1873
commit 0667cbeefb
8 changed files with 0 additions and 2185 deletions

View File

@ -11,7 +11,6 @@
// about supported directives.
//
//= require turbolinks
//= require pagedown_bootstrap
//= require rails-timeago
//= require locales/jquery.timeago.de.js
//

View File

@ -52,5 +52,4 @@ $(document).on('turbolinks:load', function() {
// Remove some elements before going back to an older site. Otherwise, they might not work.
$(document).on('turbolinks:before-cache', function() {
$('.chosen-container').remove();
$('#wmd-button-row-description').remove();
});

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +0,0 @@
//= require markdown.converter
// markdown.editor is slightly adjusted to work with Bootstrap 4.
// Taken from https://github.com/hughevans/pagedown-bootstrap-rails, V2.1.4
//= require markdown.editor
//= require markdown.sanitizer
//= require markdown.extra
renderPagedown = function() {
$(".wmd-output").each(function (i) {
const converter = Markdown.getSanitizingConverter();
const content = $(this).html();
return $(this).html(converter.makeHtml(content));
})
};
createPagedownEditor = function( selector, context ) {
if (context == null) { context = 'body'; }
return $(selector, context).each(function(i, input) {
if ($(input).data('is_rendered')) {
return;
}
const attr = $(input).attr('id').split('wmd-input')[1];
const converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter);
const help = {
handler() {
window.open('https://daringfireball.net/projects/markdown/syntax', '_blank');
return false;
},
title: "<%= I18n.t('components.markdown_editor.help', default: 'Markdown Editing Help') %>"
};
const editor = new Markdown.Editor(converter, attr, help);
editor.run();
$('[data-bs-toggle="tooltip"]').tooltip();
return $(input).data('is_rendered', true);
});
};
$(document).on('turbolinks:load', function() {
renderPagedown();
return createPagedownEditor('.wmd-input');
});

View File

@ -10,7 +10,6 @@
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require pagedown_bootstrap
*
* lib/assets
*= require flash

View File

@ -31,7 +31,3 @@
.toggle-input {
font-size: 80%;
}
.wmd-preview {
background-color: var(--bs-secondary-bg);
}