Project

General

Profile

Feature #40588 » 0001-adds-setting-to-disable-JS-based-table-sort-in-wiki-.patch

Jens Krämer, 2024-12-09 08:51

View differences:

app/assets/javascripts/application.js
}
function setupWikiTableSortableHeader() {
if (typeof Tablesort === 'undefined') { return; }
$('div.wiki table').each(function(i, table){
if (table.rows.length < 3) return true;
var tr = $(table.rows).first();
app/helpers/application_helper.rb
tags = javascript_include_tag(
'jquery-3.7.1-ui-1.13.3',
'rails-ujs',
'tribute-5.1.3.min',
'tablesort-5.2.1.min.js',
'tablesort-5.2.1.number.min.js',
'application',
'responsive'
'tribute-5.1.3.min'
)
if Setting.wiki_tablesort_enabled?
tags << javascript_include_tag('tablesort-5.2.1.min.js', 'tablesort-5.2.1.number.min.js')
end
tags << javascript_include_tag('application', 'responsive')
unless User.current.pref.warn_on_leaving_unsaved == '0'
warn_text = escape_javascript(l(:text_warn_on_leaving_unsaved))
tags <<
app/views/settings/_display.html.erb
<p><%= setting_text_field :thumbnails_size, :size => 6 %></p>
<p><%= setting_select :new_item_menu_tab, [[l(:label_none), '0'], [l(:label_new_project_issue_tab_enabled), '1'], [l(:label_new_object_tab_enabled), '2']] %></p>
<p><%= setting_check_box :wiki_tablesort_enabled %></p>
</div>
<%= submit_tag l(:button_save) %>
config/locales/de.yml
zero: "%{filename}"
one: "%{filename} and 1 file"
other: "%{filename} and %{count} files"
setting_wiki_tablesort_enabled: Javascript-basierte Tabellensortierung in Wiki-Inhalten
config/locales/en.yml
text_user_destroy_confirmation: "Are you sure you want to delete this user and remove all references to them? This cannot be undone. Often, locking a user instead of deleting them is the better solution. To confirm, please enter their login (%{login}) below."
text_project_destroy_enter_identifier: "To confirm, please enter the project's identifier (%{identifier}) below."
field_name_or_email_or_login: Name, email or login
setting_wiki_tablesort_enabled: Javascript based table sorting in wiki content
config/settings.yml
default: 1
show_status_changes_in_mail_subject:
default: 1
wiki_tablesort_enabled:
default: 1
(5-5/5)