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
1130 1130
}
1131 1131

  
1132 1132
function setupWikiTableSortableHeader() {
1133
  if (typeof Tablesort === 'undefined') { return; }
1133 1134
  $('div.wiki table').each(function(i, table){
1134 1135
    if (table.rows.length < 3) return true;
1135 1136
    var tr = $(table.rows).first();
app/helpers/application_helper.rb
1790 1790
    tags = javascript_include_tag(
1791 1791
      'jquery-3.7.1-ui-1.13.3',
1792 1792
      'rails-ujs',
1793
      'tribute-5.1.3.min',
1794
      'tablesort-5.2.1.min.js',
1795
      'tablesort-5.2.1.number.min.js',
1796
      'application',
1797
      'responsive'
1793
      'tribute-5.1.3.min'
1798 1794
    )
1795
    if Setting.wiki_tablesort_enabled?
1796
      tags << javascript_include_tag('tablesort-5.2.1.min.js', 'tablesort-5.2.1.number.min.js')
1797
    end
1798
    tags << javascript_include_tag('application', 'responsive')
1799 1799
    unless User.current.pref.warn_on_leaving_unsaved == '0'
1800 1800
      warn_text = escape_javascript(l(:text_warn_on_leaving_unsaved))
1801 1801
      tags <<
app/views/settings/_display.html.erb
29 29
<p><%= setting_text_field :thumbnails_size, :size => 6 %></p>
30 30

  
31 31
<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>
32

  
33
<p><%= setting_check_box :wiki_tablesort_enabled %></p>
32 34
</div>
33 35

  
34 36
<%= submit_tag l(:button_save) %>
config/locales/de.yml
1462 1462
    zero: "%{filename}"
1463 1463
    one: "%{filename} and 1 file"
1464 1464
    other: "%{filename} and %{count} files"
1465
  setting_wiki_tablesort_enabled: Javascript-basierte Tabellensortierung in Wiki-Inhalten
config/locales/en.yml
1424 1424
  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."
1425 1425
  text_project_destroy_enter_identifier: "To confirm, please enter the project's identifier (%{identifier}) below."
1426 1426
  field_name_or_email_or_login: Name, email or login
1427
  setting_wiki_tablesort_enabled: Javascript based table sorting in wiki content
config/settings.yml
349 349
  default: 1
350 350
show_status_changes_in_mail_subject:
351 351
  default: 1
352
wiki_tablesort_enabled:
353
  default: 1
(5-5/5)