pagy 7.0.11 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/apps/calendar.ru +2196 -0
  3. data/lib/apps/demo.ru +452 -0
  4. data/lib/apps/rails.ru +205 -0
  5. data/lib/apps/repro.ru +168 -0
  6. data/lib/bin/pagy +83 -0
  7. data/lib/config/pagy.rb +6 -17
  8. data/lib/javascripts/pagy-dev.js +10 -10
  9. data/lib/javascripts/pagy-module.js +9 -9
  10. data/lib/javascripts/pagy.js +1 -1
  11. data/lib/locales/ar.yml +2 -2
  12. data/lib/locales/be.yml +4 -4
  13. data/lib/locales/bg.yml +4 -4
  14. data/lib/locales/bs.yml +4 -4
  15. data/lib/locales/ca.yml +4 -4
  16. data/lib/locales/ckb.yml +4 -4
  17. data/lib/locales/cs.yml +4 -4
  18. data/lib/locales/da.yml +4 -4
  19. data/lib/locales/de.yml +4 -4
  20. data/lib/locales/en.yml +4 -4
  21. data/lib/locales/es.yml +2 -2
  22. data/lib/locales/fr.yml +4 -4
  23. data/lib/locales/hr.yml +4 -4
  24. data/lib/locales/id.yml +4 -4
  25. data/lib/locales/it.yml +4 -4
  26. data/lib/locales/ja.yml +4 -4
  27. data/lib/locales/km.yml +4 -4
  28. data/lib/locales/ko.yml +4 -4
  29. data/lib/locales/nb.yml +4 -4
  30. data/lib/locales/nl.yml +4 -4
  31. data/lib/locales/nn.yml +4 -4
  32. data/lib/locales/pl.yml +4 -4
  33. data/lib/locales/pt-BR.yml +2 -2
  34. data/lib/locales/pt.yml +2 -2
  35. data/lib/locales/ru.yml +4 -4
  36. data/lib/locales/sr.yml +4 -4
  37. data/lib/locales/sv-SE.yml +4 -4
  38. data/lib/locales/sv.yml +4 -4
  39. data/lib/locales/sw.yml +4 -4
  40. data/lib/locales/ta.yml +4 -4
  41. data/lib/locales/tr.yml +4 -4
  42. data/lib/locales/uk.yml +4 -4
  43. data/lib/locales/vi.yml +4 -4
  44. data/lib/locales/zh-CN.yml +4 -4
  45. data/lib/locales/zh-HK.yml +4 -4
  46. data/lib/locales/zh-TW.yml +4 -4
  47. data/lib/optimist.rb +1022 -0
  48. data/lib/pagy/extras/bootstrap.rb +52 -63
  49. data/lib/pagy/extras/bulma.rb +48 -64
  50. data/lib/pagy/extras/foundation.rb +49 -61
  51. data/lib/pagy/extras/items.rb +21 -18
  52. data/lib/pagy/extras/{frontend_helpers.rb → js_tools.rb} +1 -1
  53. data/lib/pagy/extras/materialize.rb +52 -51
  54. data/lib/pagy/extras/pagy.rb +82 -0
  55. data/lib/pagy/extras/semantic.rb +46 -50
  56. data/lib/pagy/extras/trim.rb +12 -12
  57. data/lib/pagy/extras/uikit.rb +48 -49
  58. data/lib/pagy/frontend.rb +31 -48
  59. data/lib/pagy/url_helpers.rb +1 -2
  60. data/lib/pagy.rb +10 -9
  61. data/lib/stylesheets/pagy.css +19 -34
  62. data/lib/stylesheets/pagy.scss +17 -19
  63. data/lib/stylesheets/pagy.tailwind.css +21 -0
  64. metadata +25 -9
  65. data/lib/pagy/extras/navs.rb +0 -51
  66. data/lib/pagy/extras/support.rb +0 -40
  67. data/lib/stylesheets/pagy.tailwind.scss +0 -24
data/lib/apps/repro.ru ADDED
@@ -0,0 +1,168 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Starting point app to try pagy or reproduce issues
4
+
5
+ # DEV USAGE
6
+ # pagy clone repro
7
+ # pagy ./repro.ru
8
+
9
+ # URL
10
+ # http://0.0.0.0:8000
11
+
12
+ # HELP
13
+ # pagy -h
14
+
15
+ # DOC
16
+ # https://ddnexus.github.io/pagy/playground/#1-repro-app
17
+
18
+ VERSION = '8.0.0'
19
+
20
+ require 'bundler/inline'
21
+ gemfile(true) do
22
+ source 'https://rubygems.org'
23
+ gem 'oj'
24
+ gem 'puma'
25
+ gem 'sinatra'
26
+ gem 'sinatra-contrib'
27
+ end
28
+
29
+ # Edit this section adding/removing the extras and Pagy::DEFAULT as needed
30
+ # pagy initializer
31
+ require 'pagy/extras/pagy'
32
+ require 'pagy/extras/items'
33
+ require 'pagy/extras/overflow'
34
+ Pagy::DEFAULT[:overflow] = :empty_page
35
+ Pagy::DEFAULT[:size] = [1, 4, 4, 1]
36
+ Pagy::DEFAULT.freeze
37
+
38
+ require 'sinatra/base'
39
+ # Sinatra application
40
+ class PagyRepro < Sinatra::Base
41
+ PAGY_JS = "pagy#{'-dev' if ENV['DEBUG']}.js".freeze
42
+
43
+ configure do
44
+ enable :inline_templates
45
+ end
46
+ include Pagy::Backend
47
+ # Serve pagy.js or pagy-dev.js
48
+ get("/#{PAGY_JS}") do
49
+ content_type 'application/javascript'
50
+ send_file Pagy.root.join('javascripts', PAGY_JS)
51
+ end
52
+ # Edit this action as needed
53
+ get '/' do
54
+ collection = MockCollection.new
55
+ @pagy, @records = pagy(collection)
56
+ erb :main # template available in the __END__ section as @@ main
57
+ end
58
+ # Edit this section adding your own helpers as needed
59
+ helpers do
60
+ include Pagy::Frontend
61
+ end
62
+ end
63
+
64
+ # Simple array-based collection that acts as a standard DB collection.
65
+ # Use it as a simple way to get a collection that acts as a AR scope, but without any DB
66
+ # or create an ActiveRecord class or anything else that you need instead
67
+ class MockCollection < Array
68
+ def initialize(arr = Array(1..1000))
69
+ super
70
+ @collection = clone
71
+ end
72
+
73
+ def offset(value)
74
+ @collection = self[value..]
75
+ self
76
+ end
77
+
78
+ def limit(value)
79
+ @collection[0, value]
80
+ end
81
+
82
+ def count(*)
83
+ size
84
+ end
85
+ end
86
+
87
+ run PagyRepro
88
+
89
+ __END__
90
+
91
+ @@ layout
92
+ <!DOCTYPE html>
93
+ <html lang="en">
94
+ <html>
95
+ <head>
96
+ <script src="<%= %(/#{PAGY_JS}) %>"></script>
97
+ <script type="application/javascript">
98
+ window.addEventListener("load", Pagy.init);
99
+ </script>
100
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
101
+ <style type="text/css">
102
+ @media screen { html, body {
103
+ font-size: 1rem;
104
+ line-heigth: 1.2s;
105
+ padding: 0;
106
+ margin: 0;
107
+ } }
108
+ body {
109
+ background: white !important;
110
+ margin: 0 !important;
111
+ font-family: sans-serif !important;
112
+ }
113
+ .content {
114
+ padding: 1rem 1.5rem 2rem !important;
115
+ }
116
+
117
+ /* Quick demo for overriding the element style attribute of certain pagy helpers
118
+ .pagy input[style] {
119
+ width: 5rem !important;
120
+ }
121
+ */
122
+
123
+ /*
124
+ If you want to customize the style,
125
+ please replace the line below with the actual file content
126
+ */
127
+ <%= Pagy.root.join('stylesheets', 'pagy.css').read %>
128
+ </style>
129
+ </head>
130
+
131
+ <body>
132
+ <%= yield %>
133
+ </body>
134
+ </html>
135
+
136
+ @@ main
137
+ <div class="content">
138
+ <h3>Pagy Repro App</h3>
139
+ <p> Self-contained, standalone Sinatra app usable to easily reproduce any pagy issue.</p>
140
+ <p>Please, report the following versions in any new issue.</p>
141
+ <h4>Versions</h4>
142
+ <ul>
143
+ <li>Ruby: <%= RUBY_VERSION %></li>
144
+ <li>Rack: <%= Rack::RELEASE %></li>
145
+ <li>Sinatra: <%= Sinatra::VERSION %></li>
146
+ <li>Pagy: <%= Pagy::VERSION %></li>
147
+ </ul>
148
+
149
+ <h4>Collection</h4>
150
+ <p>@records: <%= @records.join(',') %></p>
151
+
152
+ <hr>
153
+
154
+ <h4>pagy_nav</h4>
155
+ <%= pagy_nav(@pagy) %>
156
+
157
+ <h4>pagy_nav_js</h4>
158
+ <%= pagy_nav_js(@pagy) %>
159
+
160
+ <h4>pagy_combo_nav_js</h4>
161
+ <%= pagy_combo_nav_js(@pagy) %>
162
+
163
+ <h4>pagy_items_selector_js</h4>
164
+ <%= pagy_items_selector_js(@pagy) %>
165
+
166
+ <h4>pagy_info</h4>
167
+ <%= pagy_info(@pagy) %>
168
+ </div>
data/lib/bin/pagy ADDED
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ VERSION = '8.0.0'
5
+ APPS = %w[repro rails demo calendar].freeze
6
+
7
+ require_relative '../optimist'
8
+ opts = Optimist.options do
9
+ text <<~HEAD
10
+ Pagy #{VERSION} (https://ddnexus.github.io/pagy/playground)
11
+ Playground to showcase, clone and develop pagy APPs
12
+ APPs
13
+ repro Reproduce generic/simple issues
14
+ rails Reproduce rails related issues
15
+ demo Showcase all the helpers and styles
16
+ calendar Showcase the calendar; reproduce related issues
17
+ USAGE
18
+ pagy APP [options] Showcase APP from the installed gem
19
+ pagy clone APP Clone APP to the current dir
20
+ pagy APPFILE [options] Develop APPFILE from local path
21
+ EXAMPLES
22
+ pagy demo Showcase demo at http://0.0.0.0:8000
23
+ pagy clone repro Clone repro to ./repro.ru
24
+ pagy ~/my-repro.ru Develop ~/my-repro.ru at http://0.0.0.0:8000
25
+ HEAD
26
+ text 'Rackup options'
27
+ opt :env, 'Environment', default: 'development'
28
+ opt :host, 'Host', default: '0.0.0.0', short: :o
29
+ opt :port, 'Port', default: 8000
30
+ text 'Rerun options'
31
+ opt :rerun, 'Enable rerun for development', default: true
32
+ opt :clear, 'Clear screen before each rerun'
33
+ text 'Other options'
34
+ opt :quiet, 'Quiet mode for development'
35
+ version VERSION
36
+ end
37
+ Optimist.educate if ARGV.empty?
38
+
39
+ require 'bundler/inline'
40
+ gemfile true do
41
+ source 'https://rubygems.org'
42
+ gem 'rackup'
43
+ gem 'rerun'
44
+ end
45
+
46
+ path = ->(app) { File.expand_path("../apps/#{app}.ru", __dir__) }
47
+ arg = ARGV.shift
48
+ if arg.eql?('clone')
49
+ arg = ARGV.shift
50
+ Optimist.die("Expected APP to be in [#{APPS.join(', ')}]; got #{arg.inspect}") unless APPS.include?(arg)
51
+ file = path.(arg)
52
+ name = File.basename(file)
53
+ if File.exist?(name)
54
+ print "Do you want to overwrite the #{name.inspect} file? (y/n)> "
55
+ answer = gets.chomp
56
+ Optimist.die("#{name.inspect} file already present") unless answer.start_with?(/y/i)
57
+ end
58
+ require 'fileutils'
59
+ FileUtils.cp(file, '.', verbose: true)
60
+ else
61
+ if APPS.include?(arg) # showcase env
62
+ opts[:env] = 'showcase'
63
+ opts[:rerun] = false
64
+ opts[:quiet] = true
65
+ # Avoid the creation of './tmp/local_secret.txt' for showcase env
66
+ ENV['SECRET_KEY_BASE'] = 'absolute secret!' if arg.eql?('rails')
67
+ file = path.(arg)
68
+ else # development env
69
+ file = arg
70
+ end
71
+ Optimist.die("#{file.inspect} app not found") unless File.exist?(file)
72
+ # Run command
73
+ rackup = "rackup -I #{File.expand_path('..', __dir__)} -r pagy -o #{opts[:host]} -p #{opts[:port]} -E #{opts[:env]} #{file}"
74
+ rackup << ' -q' if opts[:quiet]
75
+ if opts[:rerun]
76
+ name = File.basename(file)
77
+ rerun = "rerun --name #{name} -d #{File.dirname(file)} -p #{name}"
78
+ rerun << ' -q' if opts[:quiet]
79
+ rerun << ' -c' if opts[:clear]
80
+ rerun << " -- #{rackup}"
81
+ end
82
+ exec(rerun || rackup)
83
+ end
data/lib/config/pagy.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Pagy initializer file (7.0.11)
3
+ # Pagy initializer file (8.0.0)
4
4
  # Customize only what you really need and notice that the core Pagy works also without any of the following lines.
5
5
  # Should you just cherry pick part of this file, please maintain the require-order of the extras
6
6
 
@@ -22,8 +22,6 @@
22
22
  # Pagy::DEFAULT[:page_param] = :page # default
23
23
  # Pagy::DEFAULT[:fragment] = '#fragment' # example
24
24
  # Pagy::DEFAULT[:link_extra] = 'data-remote="true"' # example
25
- # Pagy::DEFAULT[:item_i18n_key = 'pagy.item_name' # default
26
- # Pagy::DEFAULT[:nav_i18n_key] = 'pagy.aria_label.nav' # default
27
25
  # Pagy::DEFAULT[:cycle] = true # example
28
26
  # Pagy::DEFAULT[:request_path] = '/foo' # example
29
27
  # Pagy::DEFAULT[:count_args] = [] # example for non AR ORMs
@@ -133,7 +131,6 @@
133
131
  # Bulma extra: Add nav, nav_js and combo_nav_js helpers and templates for Bulma pagination
134
132
  # See https://ddnexus.github.io/pagy/docs/extras/bulma
135
133
  # require 'pagy/extras/bulma'
136
- # DEFAULT[:bulma_nav_classes] = 'is-centered' # default
137
134
 
138
135
  # Foundation extra: Add nav, nav_js and combo_nav_js helpers and templates for Foundation pagination
139
136
  # See https://ddnexus.github.io/pagy/docs/extras/foundation
@@ -143,11 +140,10 @@
143
140
  # See https://ddnexus.github.io/pagy/docs/extras/materialize
144
141
  # require 'pagy/extras/materialize'
145
142
 
146
- # Navs extra: Add nav_js and combo_nav_js javascript helpers
147
- # Notice: the other frontend extras add their own framework-styled versions,
148
- # so require this extra only if you need the unstyled version
149
- # See https://ddnexus.github.io/pagy/docs/extras/navs
150
- # require 'pagy/extras/navs'
143
+ # Pagy extra: Add the pagy styled versions of the javascript-powered navs
144
+ # and a few other components to the Pagy::Frontend module.
145
+ # See https://ddnexus.github.io/pagy/docs/extras/pagy
146
+ # require 'pagy/extras/pagy'
151
147
 
152
148
  # Semantic extra: Add nav, nav_js and combo_nav_js helpers for Semantic UI pagination
153
149
  # See https://ddnexus.github.io/pagy/docs/extras/semantic
@@ -158,7 +154,7 @@
158
154
  # require 'pagy/extras/uikit'
159
155
 
160
156
  # Multi size var used by the *_nav_js helpers
161
- # See https://ddnexus.github.io/pagy/docs/extras/navs#steps
157
+ # See https://ddnexus.github.io/pagy/docs/extras/pagy#steps
162
158
  # Pagy::DEFAULT[:steps] = { 0 => [2,3,3,2], 540 => [3,5,5,3], 720 => [5,7,7,5] } # example
163
159
 
164
160
 
@@ -184,10 +180,6 @@
184
180
  # require 'pagy/extras/overflow'
185
181
  # Pagy::DEFAULT[:overflow] = :empty_page # default (other options: :last_page and :exception)
186
182
 
187
- # Support extra: Extra support for features like: incremental, infinite, auto-scroll pagination
188
- # See https://ddnexus.github.io/pagy/docs/extras/support
189
- # require 'pagy/extras/support'
190
-
191
183
  # Trim extra: Remove the page=1 param from links
192
184
  # See https://ddnexus.github.io/pagy/docs/extras/trim
193
185
  # require 'pagy/extras/trim'
@@ -250,9 +242,6 @@
250
242
  # See https://ddnexus.github.io/pagy/docs/extras/i18n
251
243
  # require 'pagy/extras/i18n'
252
244
 
253
- # Default i18n key
254
- # Pagy::DEFAULT[:item_i18n_key] = 'pagy.item_name' # default
255
-
256
245
 
257
246
  # When you are done setting your own default freeze it, so it will not get changed accidentally
258
247
  Pagy::DEFAULT.freeze
@@ -3,17 +3,17 @@ window.Pagy = (() => {
3
3
  // The observer instance for responsive navs
4
4
  const rjsObserver = new ResizeObserver(entries => entries.forEach(e => e.target.querySelectorAll(".pagy-rjs").forEach(el => el.pagyRender())));
5
5
  // Init the *_nav_js helpers
6
- const initNav = (el, [tags, sequels, labelSequels, trimParam]) => {
6
+ const initNav = (el, [tokens, sequels, labelSequels, trimParam]) => {
7
7
  const container = el.parentElement ?? el;
8
8
  const widths = Object.keys(sequels).map(w => parseInt(w)).sort((a, b) => b - a);
9
9
  let lastWidth = -1;
10
- const fillIn = (link, page, label) => link.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);
10
+ const fillIn = (a, page, label) => a.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);
11
11
  (el.pagyRender = function () {
12
12
  const width = widths.find(w => w < container.clientWidth) || 0;
13
13
  if (width === lastWidth) {
14
14
  return;
15
15
  } // no change: abort
16
- let html = tags.before; // already trimmed in html
16
+ let html = tokens.before; // already trimmed in html
17
17
  const series = sequels[width.toString()];
18
18
  const labels = labelSequels?.[width.toString()] ?? series.map(l => l.toString());
19
19
  for (const i in series) {
@@ -21,17 +21,17 @@ window.Pagy = (() => {
21
21
  const label = labels[i];
22
22
  let filled;
23
23
  if (typeof item === "number") {
24
- filled = fillIn(tags.link, item.toString(), label);
24
+ filled = fillIn(tokens.a, item.toString(), label);
25
25
  }
26
26
  else if (item === "gap") {
27
- filled = tags.gap;
27
+ filled = tokens.gap;
28
28
  }
29
29
  else { // active page
30
- filled = fillIn(tags.active, item, label);
30
+ filled = fillIn(tokens.current, item, label);
31
31
  }
32
32
  html += (typeof trimParam === "string" && item == 1) ? trim(filled, trimParam) : filled;
33
33
  }
34
- html += tags.after; // eslint-disable-line align-assignments/align-assignments
34
+ html += tokens.after; // eslint-disable-line align-assignments/align-assignments
35
35
  el.innerHTML = "";
36
36
  el.insertAdjacentHTML("afterbegin", html);
37
37
  lastWidth = width;
@@ -77,10 +77,10 @@ window.Pagy = (() => {
77
77
  } }); // trigger action
78
78
  };
79
79
  // Trim the ${page-param}=1 params in links
80
- const trim = (link, param) => link.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
80
+ const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
81
81
  // Public interface
82
82
  return {
83
- version: "7.0.11",
83
+ version: "8.0.0",
84
84
  // Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
85
85
  init(arg) {
86
86
  const target = arg instanceof Element ? arg : document;
@@ -109,4 +109,4 @@ window.Pagy = (() => {
109
109
  }
110
110
  };
111
111
  })();
112
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFneS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBhZ3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQWtCQSxNQUFNLElBQUksR0FBRyxDQUFDLEdBQUcsRUFBRTtJQUNmLDRDQUE0QztJQUM1QyxNQUFNLFdBQVcsR0FBRyxJQUFJLGNBQWMsQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUNOLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLGdCQUFnQixDQUFhLFdBQVcsQ0FBQyxDQUFDLE9BQU8sQ0FDM0UsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsVUFBVSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFFeEUsNEJBQTRCO0lBQzVCLE1BQU0sT0FBTyxHQUFHL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yaW5nKTpzdHJpbmcgPT5cbiAgICAgICAgICAgIGxpbmsucmVwbGFjZSgvX19wYWd5X3BhZ2VfXy9nLCBwYWdlKS5yZXBsYWNlKC9fX3BhZ3lfbGFiZWxfXy9nLCBsYWJlbCk7XG4gICAgICAgIChlbC5wYWd5UmVuZGVyID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgY29uc3Qgd2lkdGggPSB3aWR0aHMuZmluZCh3ID0+IHcgPCBjb250YWluZXIuY2xpZW50V2lkdGgpIHx8IDA7XG4gICAgICAgICAgICBpZiAod2lkdGggPT09IGxhc3RXaWR0aCkgeyByZXR1cm4gfSAvLyBubyBjaGFuZ2U6IGFib3J0XG4gICAgICAgICAgICBsZXQgaHRtbCA9IHRhZ3MuYmVmb3JlOyAgLy8gYWxyZWFkeSB0cmltbWVkIGluIGh0bWxcbiAgICAgICAgICAgIGNvbnN0IHNlcmllcyA9IHNlcXVlbHNbd2lkdGgudG9TdHJpbmcoKV07XG4gICAgICAgICAgICBjb25zdCBsYWJlbHMgPSBsYWJlbFNlcXVlbHM/Llt3aWR0aC50b1N0cmluZygpXSA/PyBzZXJpZXMubWFwKGwgPT4gbC50b1N0cmluZygpKTtcbiAgICAgICAgICAgIGZvciAoY29uc3QgaSBpbiBzZXJpZXMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpdGVtID0gc2VyaWVzW2ldO1xuICAgICAgICAgICAgICAgIGNvbnN0IGxhYmVsID0gbGFiZWxzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpdGVtID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGZpbGxJbih0YWdzLmxpbmssIGl0ZW0udG9TdHJpbmcoKSwgbGFiZWwpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaXRlbSA9PT0gXCJnYXBcIikge1xuICAgICAgICAgICAgICAgICAgICB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wdXQubWF4XS5tYXAobiA9PiBwYXJzZUludChuKSB8fCAwKTtcbiAgICAgICAgICAgIGlmICh2YWwgPCBtaW4gfHwgdmFsID4gbWF4KSB7ICAvLyByZXNldCBpbnZhbGlkL291dC1vZi1yYW5nZVxuICAgICAgICAgICAgICAgIGlucHV0LnZhbHVlID0gaW5pdGlhbDtcbiAgICAgICAgICAgICAgICBpbnB1dC5zZWxlY3QoKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgW3BhZ2UsIHVybF0gPSBnZXRWYXJzKGlucHV0LnZhbHVlKTsgICAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIHByZWZlci1jb25zdFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmltUGFyYW0gPT09IFwic3RyaW5nXCIgJiYgcGFnZSA9PT0gXCIxXCIpIHsgdXJsID0gdHJpbSh1cmwsIHRyaW1QYXJhbSkgfVxuICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLmhyZWYgPSB1cmw7XG4gICAgICAgIH07XG4gICAgICAgIFtcImNoYW5nZVwiLCBcImZvY3VzXCJdLmZvckVhY2goZSA9PiBpbnB1dC5hZGRFdmVudExpc3RlbmVyKGUsIGlucHV0LnNlbGVjdCkpOyAgICAgICAgLy8gYXV0by1zZWxlY3RcbiAgICAgICAgaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcihcImZvY3Vzb3V0XCIsIGFjdGlvbik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdHJpZ2dlciBhY3Rpb25cbiAgICAgICAgaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcihcImtleXByZXNzXCIsIGUgPT4geyBpZiAoZS5rZXkgPT09IFwiRW50ZXJcIikgeyBhY3Rpb24oKSB9IH0pOyAvLyB0cmlnZ2VyIGFjdGlvblxuICAgIH07XG5cbiAgICAvLyBUcmltIHRoZSAke3BhZ2UtcGFyYW19PTEgcGF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T04gLT4gQXJyYXlcbiAgICAgICAgICAgICAgICAgICAgaWYgKGtleXdvcmQgPT09IFwibmF2XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaXROYXYoZWwgYXMgTmF2RWxlbWVudCwgYXJncyBhcyBOYXZBcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXl3b3JkID09PSBcImNvbWJvXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaXRDb21ibyhlbCwgYXJncyBhcyBDb21ib0FyZ3MpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleXdvcmQgPT09IFwic2VsZWN0b3JcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdFNlbGVjdG9yKGVsLCBhcmdzIGFzIFNlbGVjdG9yQXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXCJTa2lwcGVkIFBhZ3kuaW5pdCgpIGZvcjogJW9cXG5Vbmtub3duIGtleXdvcmQgJyVzJ1wiLCBlbCwga2V5d29yZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHsgY29uc29sZS53YXJuKFwiU2tpcHBlZCBQYWd5LmluaXQoKSBmb3I6ICVvXFxuJXNcIiwgZWwsIGVycikgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbn0pKCk7XG4iXX0=
112
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFneS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBhZ3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQWtCQSxNQUFNLElBQUksR0FBRyxDQUFDLEdBQUcsRUFBRTtJQUNmLDRDQUE0QztJQUM1QyxNQUFNLFdBQVcsR0FBRyxJQU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AgICAgICAgICAgIGNvbnN0IGxhYmVsID0gbGFiZWxzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpdGVtID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGZpbGxJbih0b2tlbnMuYSwgaXRlbS50b1N0cmluZygpLCBsYWJlbCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpdGVtID09PSBcImdhcFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHRva2Vucy5nYXA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gYWN0aXZlIHBhZ2VcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkID0gZmlsbEluKHRva2Vucy5jdXJyZW50LCBpdGVtLCBsYWJlbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGh0bWwgKz0gKHR5cGVvZiB0cmltUGFyYW0gPT09IFwic3RyaW5nXCIgJiYgaXRlbSA9PSAxKSA/IHRyaW0oZmlsbGVkLCB0cmltUGFyYW0pIDogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaHRtbCArPSB0b2tlbnMuYWZ0ZXI7ICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBhbGlnbi1hc3NpZ25tZW50cy9hbGlnbi1hc3NpZ25tZW50c1xuICAgICAgICAgICAgZWwuaW5uZXJIVE1MID0gXCJcIjtcbiAgICAgICAgICAgIGVsLmluc2VydEFkamFjZW50SFRNTChcImFmdGVyYmVnaW5cIiwgaHRtbCk7XG4gICAgICAgICAgICBsYXN0V2lkdGggPSB3aWR0aDtcbiAgICAgICAgfSkoKTtcbiAgICAgICAgaWYgKGVsLmNsYXNzTGlzdC5jb250YWlucyhcInBhZ3ktcmpzXCIpKSB7IHJqc09ic2VydmVyLm9ic2VydmUoY29udGFpbmVyKSB9XG4gICAgfTt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eVNlbGVjdG9yKFwiaW5wdXRcIikgYXMgSFRNTElucHV0RWxlbWVudDtcbiAgICAgICAgY29uc3QgaW5pdGlhbCA9IGlucHV0LnZhbHVlO1xuICAgICAgICBjb25zdCBhY3Rpb24gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoaW5wdXQudmFsdWUgPT09IGluaXRpYWwpIHsgcmV0dXJuIH0gIC8vIG5vdCBjaGFuZ2VkXG4gICAgICAgICAgICBjb25zdCBbbWluLCB2YWwsIG1heF0gPSBbaW5wdXQubWluLCBpbnB1dC52YWx1ZSwgaW5wdXQubWF4XS5tYXAobiA9PiBwYXJzZUludChuKSB8fCAwKTtcbiAgICAgICAgICAgIGlmICh2YWwgPCBtaW4gfHwgdmFsID4gbWF4KSB7ICAvLyByZXNldCBpbnZhbGlkL291dC1vZi1yYW5nZVxuICAgICAgICAgICAgICAgIGlucHV0LnZhbHVlID0gaW5pdGlhbDtcbiAgICAgICAgICAgICAgICBpbnB1dC5zZWxlY3QoKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgW3BhZ2UsIHVybF0gPSBnZXRWYXJzKGlucHV0LnZhbHVlKTsgICAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIHByZWZlci1jb25zdFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmltUGFyYW0gPT09IFwic3RyaW5nXCIgJiYgcGFnZSA9PT0gXCIxXCIpIHsgdXJsID0gdHJpbSh1cmwsIHRyaW1QYXJhbSkgfVxuICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLmhyZWYgPSB1cmw7XG4gICAgICAgIH07XG4gICAgICAgIFtcImNoYW5nZVwiLCBcImZvY3VzXCJdLmZvckVhY2goZSA9PiBpbnB1dC5hZGRFdmVudExpc3RlbmVyKGUsIGlucHV0LnNlbGVjdCkpOyAgICAgICAgLy8gYXV0by1zZWxlY3RcbiAgICAgICAgaW5wdXQuYWRkR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AgICAgICAgIGNvbnN0IHVpbnQ4YXJyYXkgPSBVaW50OEFycmF5LmZyb20oYXRvYihlbC5nZXRBdHRyaWJ1dGUoXCJkYXRhLXBhZ3lcIikgYXMgc3RyaW5nKSwgYyA9PiBjLmNoYXJDb2RlQXQoMCkpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBba2V5d29yZCwgLi4uYXJnc10gPSBKU09OLnBhcnNlKChuZXcgVGV4dERlY29kZXIoKSkuZGVjb2RlKHVpbnQ4YXJyYXkpKTsgLy8gYmFzZTY0LXV0ZjggLT4gSlNPTiAtPiBBcnJheVxuICAgICAgICAgICAgICAgICAgICBpZiAoa2V5d29yZCA9PT0gXCJuYXZcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdE5hdihlbCBhcyBOYXZFbGVtZW50LCBhcmdzIGFzIE5hdkFyZ3MpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleXdvcmQgPT09IFwiY29tYm9cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdENvbWJvKGVsLCBhcmdzIGFzIENvbWJvQXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxlY3RvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0U2VsZWN0b3IoZWwsIGFyZ3MgYXMgU2VsZWN0b3JBcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcIlNraXBwZWQgUGFneS5pbml0KCkgZm9yOiAlb1xcblVua25vd24ga2V5d29yZCAnJXMnXCIsIGVsLCBrZXl3b3JkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikgeyBjb25zb2xlLndhcm4oXCJTa2lwcGVkIFBhZ3kuaW5pdCgpIGZvcjogJW9cXG4lc1wiLCBlbCwgZXJyKSB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xufSkoKTtcbiJdfQ==
@@ -2,17 +2,17 @@ const Pagy = (() => {
2
2
  // The observer instance for responsive navs
3
3
  const rjsObserver = new ResizeObserver(entries => entries.forEach(e => e.target.querySelectorAll(".pagy-rjs").forEach(el => el.pagyRender())));
4
4
  // Init the *_nav_js helpers
5
- const initNav = (el, [tags, sequels, labelSequels, trimParam]) => {
5
+ const initNav = (el, [tokens, sequels, labelSequels, trimParam]) => {
6
6
  const container = el.parentElement ?? el;
7
7
  const widths = Object.keys(sequels).map(w => parseInt(w)).sort((a, b) => b - a);
8
8
  let lastWidth = -1;
9
- const fillIn = (link, page, label) => link.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);
9
+ const fillIn = (a, page, label) => a.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);
10
10
  (el.pagyRender = function () {
11
11
  const width = widths.find(w => w < container.clientWidth) || 0;
12
12
  if (width === lastWidth) {
13
13
  return;
14
14
  } // no change: abort
15
- let html = tags.before; // already trimmed in html
15
+ let html = tokens.before; // already trimmed in html
16
16
  const series = sequels[width.toString()];
17
17
  const labels = labelSequels?.[width.toString()] ?? series.map(l => l.toString());
18
18
  for (const i in series) {
@@ -20,17 +20,17 @@ const Pagy = (() => {
20
20
  const label = labels[i];
21
21
  let filled;
22
22
  if (typeof item === "number") {
23
- filled = fillIn(tags.link, item.toString(), label);
23
+ filled = fillIn(tokens.a, item.toString(), label);
24
24
  }
25
25
  else if (item === "gap") {
26
- filled = tags.gap;
26
+ filled = tokens.gap;
27
27
  }
28
28
  else { // active page
29
- filled = fillIn(tags.active, item, label);
29
+ filled = fillIn(tokens.current, item, label);
30
30
  }
31
31
  html += (typeof trimParam === "string" && item == 1) ? trim(filled, trimParam) : filled;
32
32
  }
33
- html += tags.after; // eslint-disable-line align-assignments/align-assignments
33
+ html += tokens.after; // eslint-disable-line align-assignments/align-assignments
34
34
  el.innerHTML = "";
35
35
  el.insertAdjacentHTML("afterbegin", html);
36
36
  lastWidth = width;
@@ -76,10 +76,10 @@ const Pagy = (() => {
76
76
  } }); // trigger action
77
77
  };
78
78
  // Trim the ${page-param}=1 params in links
79
- const trim = (link, param) => link.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
79
+ const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
80
80
  // Public interface
81
81
  return {
82
- version: "7.0.11",
82
+ version: "8.0.0",
83
83
  // Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
84
84
  init(arg) {
85
85
  const target = arg instanceof Element ? arg : document;
@@ -1 +1 @@
1
- !function(){let e=(()=>{let e=new ResizeObserver(e=>e.forEach(e=>e.target.querySelectorAll(".pagy-rjs").forEach(e=>e.pagyRender()))),t=(t,[r,n,a,i])=>{let l=t.parentElement??t,p=Object.keys(n).map(e=>parseInt(e)).sort((e,t)=>t-e),c=-1,s=(e,t,r)=>e.replace(/__pagy_page__/g,t).replace(/__pagy_label__/g,r);(t.pagyRender=function(){let e=p.find(e=>e<l.clientWidth)||0;if(e===c)return;let g=r.before,f=n[e.toString()],y=a?.[e.toString()]??f.map(e=>e.toString());for(let e in f){let t;let n=f[e],a=y[e];t="number"==typeof n?s(r.link,n.toString(),a):"gap"===n?r.gap:s(r.active,n,a),g+="string"==typeof i&&1==n?o(t,i):t}g+=r.after,t.innerHTML="",t.insertAdjacentHTML("afterbegin",g),c=e})(),t.classList.contains("pagy-rjs")&&e.observe(l)},r=(e,[t,r])=>a(e,e=>[e,t.replace(/__pagy_page__/,e)],r),n=(e,[t,r,n])=>{a(e,e=>{let n=Math.max(Math.ceil(t/parseInt(e)),1).toString(),a=r.replace(/__pagy_page__/,n).replace(/__pagy_items__/,e);return[n,a]},n)},a=(e,t,r)=>{let n=e.querySelector("input"),a=n.value,i=function(){if(n.value===a)return;let[e,i,l]=[n.min,n.value,n.max].map(e=>parseInt(e)||0);if(i<e||i>l){n.value=a,n.select();return}let[p,c]=t(n.value);"string"==typeof r&&"1"===p&&(c=o(c,r)),window.location.href=c};["change","focus"].forEach(e=>n.addEventListener(e,n.select)),n.addEventListener("focusout",i),n.addEventListener("keypress",e=>{"Enter"===e.key&&i()})},o=(e,t)=>e.replace(RegExp(`[?&]${t}=1\\b(?!&)|\\b${t}=1&`),"");return{version:"7.0.11",init(e){for(let a of(e instanceof Element?e:document).querySelectorAll("[data-pagy]"))try{let e=Uint8Array.from(atob(a.getAttribute("data-pagy")),e=>e.charCodeAt(0)),[o,...i]=JSON.parse(new TextDecoder().decode(e));"nav"===o?t(a,i):"combo"===o?r(a,i):"selector"===o?n(a,i):console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",a,o)}catch(e){console.warn("Skipped Pagy.init() for: %o\n%s",a,e)}}}})();window.Pagy=e}();
1
+ !function(){let e=(()=>{let e=new ResizeObserver(e=>e.forEach(e=>e.target.querySelectorAll(".pagy-rjs").forEach(e=>e.pagyRender()))),t=(t,[r,n,a,i])=>{let l=t.parentElement??t,p=Object.keys(n).map(e=>parseInt(e)).sort((e,t)=>t-e),c=-1,s=(e,t,r)=>e.replace(/__pagy_page__/g,t).replace(/__pagy_label__/g,r);(t.pagyRender=function(){let e=p.find(e=>e<l.clientWidth)||0;if(e===c)return;let g=r.before,f=n[e.toString()],y=a?.[e.toString()]??f.map(e=>e.toString());for(let e in f){let t;let n=f[e],a=y[e];t="number"==typeof n?s(r.a,n.toString(),a):"gap"===n?r.gap:s(r.current,n,a),g+="string"==typeof i&&1==n?o(t,i):t}g+=r.after,t.innerHTML="",t.insertAdjacentHTML("afterbegin",g),c=e})(),t.classList.contains("pagy-rjs")&&e.observe(l)},r=(e,[t,r])=>a(e,e=>[e,t.replace(/__pagy_page__/,e)],r),n=(e,[t,r,n])=>{a(e,e=>{let n=Math.max(Math.ceil(t/parseInt(e)),1).toString(),a=r.replace(/__pagy_page__/,n).replace(/__pagy_items__/,e);return[n,a]},n)},a=(e,t,r)=>{let n=e.querySelector("input"),a=n.value,i=function(){if(n.value===a)return;let[e,i,l]=[n.min,n.value,n.max].map(e=>parseInt(e)||0);if(i<e||i>l){n.value=a,n.select();return}let[p,c]=t(n.value);"string"==typeof r&&"1"===p&&(c=o(c,r)),window.location.href=c};["change","focus"].forEach(e=>n.addEventListener(e,n.select)),n.addEventListener("focusout",i),n.addEventListener("keypress",e=>{"Enter"===e.key&&i()})},o=(e,t)=>e.replace(RegExp(`[?&]${t}=1\\b(?!&)|\\b${t}=1&`),"");return{version:"8.0.0",init(e){for(let a of(e instanceof Element?e:document).querySelectorAll("[data-pagy]"))try{let e=Uint8Array.from(atob(a.getAttribute("data-pagy")),e=>e.charCodeAt(0)),[o,...i]=JSON.parse(new TextDecoder().decode(e));"nav"===o?t(a,i):"combo"===o?r(a,i):"selector"===o?n(a,i):console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",a,o)}catch(e){console.warn("Skipped Pagy.init() for: %o\n%s",a,e)}}}})();window.Pagy=e}();
data/lib/locales/ar.yml CHANGED
@@ -24,7 +24,7 @@ ar:
24
24
  other: "عناصر"
25
25
  info:
26
26
  no_items: "لا يوجد %{item_name}"
27
- single_page: "عرض <b>%{count}</b> %{item_name}"
28
- multiple_pages: "عرض %{item_name} <b>%{from}-%{to}</b> من اجمالي <b>%{count}</b>"
27
+ single_page: "عرض %{count} %{item_name}"
28
+ multiple_pages: "عرض %{item_name} %{from}-%{to} من اجمالي %{count}"
29
29
  combo_nav_js: "الصفحة %{page_input} من %{pages}"
30
30
  items_selector_js: "عرض %{items_input} %{item_name} لكل صفحة"
data/lib/locales/be.yml CHANGED
@@ -19,7 +19,7 @@ be:
19
19
  other: "запісаў"
20
20
  info:
21
21
  no_items: "Пакуль %{item_name} няма"
22
- single_page: "<b>%{count}</b> %{item_name}"
23
- multiple_pages: "Усяго <b>%{count}</b> %{item_name}, паказаны з <b>%{from}</b> па <b>%{to}</b>"
24
- combo_nav_js: "<label>Старонка %{page_input} з %{pages}</label>"
25
- items_selector_js: "<label>Паказаць %{items_input} %{item_name} на старонцы</label>"
22
+ single_page: "%{count} %{item_name}"
23
+ multiple_pages: "Усяго %{count} %{item_name}, паказаны з %{from} па %{to}"
24
+ combo_nav_js: "Старонка %{page_input} з %{pages}"
25
+ items_selector_js: "Паказаць %{items_input} %{item_name} на старонцы"
data/lib/locales/bg.yml CHANGED
@@ -15,7 +15,7 @@ bg:
15
15
  other: "резултати"
16
16
  info:
17
17
  no_items: "Няма намерени %{item_name}"
18
- single_page: "Показани са <b>%{count}</b> %{item_name}"
19
- multiple_pages: "Показани са %{item_name} <b>%{from}-%{to}</b> от <b>%{count}</b> общо"
20
- combo_nav_js: "<label>Страница %{page_input} от %{pages}</label>"
21
- items_selector_js: "<label>Покажи %{items_input} %{item_name} на страница</label>"
18
+ single_page: "Показани са %{count} %{item_name}"
19
+ multiple_pages: "Показани са %{item_name} %{from}-%{to} от %{count} общо"
20
+ combo_nav_js: "Страница %{page_input} от %{pages}"
21
+ items_selector_js: "Покажи %{items_input} %{item_name} на страница"
data/lib/locales/bs.yml CHANGED
@@ -19,7 +19,7 @@ bs:
19
19
  other: "stavki"
20
20
  info:
21
21
  no_items: "Nije pronađena %{item_name}"
22
- single_page: "Prikazuje se <b>%{count}</b> %{item_name}"
23
- multiple_pages: "Prikaz %{item_name} <b>%{from}-%{to}</b> od <b>%{count}</b> ukupno"
24
- combo_nav_js: "<label>Stranica %{page_input} od %{pages}</label>"
25
- items_selector_js: "<label>Prikaži %{items_input} %{item_name} po stranici</label>"
22
+ single_page: "Prikazuje se %{count} %{item_name}"
23
+ multiple_pages: "Prikaz %{item_name} %{from}-%{to} od %{count} ukupno"
24
+ combo_nav_js: "Stranica %{page_input} od %{pages}"
25
+ items_selector_js: "Prikaži %{items_input} %{item_name} po stranici"
data/lib/locales/ca.yml CHANGED
@@ -17,7 +17,7 @@ ca:
17
17
  other: "elements"
18
18
  info:
19
19
  no_items: "No s'ha trobat cap resultat"
20
- single_page: "Mostrant <b>%{count}</b> %{item_name}"
21
- multiple_pages: "Mostrant %{item_name} <b>%{from}-%{to}</b> de <b>%{count}</b> en total"
22
- combo_nav_js: "<label>Pàgina %{page_input} de %{pages}</label>"
23
- items_selector_js: "<label>Mostra %{items_input} %{item_name} per pàgina</label>"
20
+ single_page: "Mostrant %{count} %{item_name}"
21
+ multiple_pages: "Mostrant %{item_name} %{from}-%{to} de %{count} en total"
22
+ combo_nav_js: "Pàgina %{page_input} de %{pages}"
23
+ items_selector_js: "Mostra %{items_input} %{item_name} per pàgina"
data/lib/locales/ckb.yml CHANGED
@@ -12,7 +12,7 @@ ckb:
12
12
  gap: "&hellip;"
13
13
  info:
14
14
  no_items: "هیچ %{item_name}ێک نەدۆزرایەوە"
15
- single_page: "پیشاندانی <b>%{count}</b> %{item_name}"
16
- multiple_pages: "پشاندانی %{item_name}ی <b>%{from}-%{to}</b> لە کۆی <b>%{count}</b> بە گشتی"
17
- combo_nav_js: "<label>پەڕی %{page_input} لە %{pages}</label>"
18
- items_selector_js: "<label>نیشاندانی %{items_input} %{item_name} لە هەر پەڕێک</label>"
15
+ single_page: "پیشاندانی %{count} %{item_name}"
16
+ multiple_pages: "پشاندانی %{item_name}ی %{from}-%{to} لە کۆی %{count} بە گشتی"
17
+ combo_nav_js: "پەڕی %{page_input} لە %{pages}"
18
+ items_selector_js: "نیشاندانی %{items_input} %{item_name} لە هەر پەڕێک"
data/lib/locales/cs.yml CHANGED
@@ -17,7 +17,7 @@ cs:
17
17
  other: "položek"
18
18
  info:
19
19
  no_items: "Nic nebylo nalezeno"
20
- single_page: "Zobrazeno <b>%{count}</b> %{item_name}"
21
- multiple_pages: "Zobrazeny položky <b>%{from}-%{to}</b> z <b>%{count}</b> celkem"
22
- combo_nav_js: "<label>Strana %{page_input} z %{pages}</label>"
23
- items_selector_js: "<label>Zobrazit %{items_input} %{item_name} na stránce</label>"
20
+ single_page: "Zobrazeno %{count} %{item_name}"
21
+ multiple_pages: "Zobrazeny položky %{from}-%{to} z %{count} celkem"
22
+ combo_nav_js: "Strana %{page_input} z %{pages}"
23
+ items_selector_js: "Zobrazit %{items_input} %{item_name} na stránce"
data/lib/locales/da.yml CHANGED
@@ -17,7 +17,7 @@ da:
17
17
  other: "resultater"
18
18
  info:
19
19
  no_items: "Ingen %{item_name} fundet"
20
- single_page: "Viser <b>%{count}</b> %{item_name}"
21
- multiple_pages: "Viser %{item_name} <b>%{from}-%{to}</b> af <b>%{count}</b> totalt"
22
- combo_nav_js: "<label>Side %{page_input} af %{pages}</label>"
23
- items_selector_js: "<label>Antal %{items_input} %{item_name} per side</label>"
20
+ single_page: "Viser %{count} %{item_name}"
21
+ multiple_pages: "Viser %{item_name} %{from}-%{to} af %{count} totalt"
22
+ combo_nav_js: "Side %{page_input} af %{pages}"
23
+ items_selector_js: "Antal %{items_input} %{item_name} per side"
data/lib/locales/de.yml CHANGED
@@ -15,7 +15,7 @@ de:
15
15
  other: "Einträge"
16
16
  info:
17
17
  no_items: "Keine %{item_name} gefunden"
18
- single_page: "Zeige <b>%{count}</b> %{item_name}"
19
- multiple_pages: "Zeige %{item_name} <b>%{from}-%{to}</b> von <b>%{count}</b> gesamt"
20
- combo_nav_js: "<label>Seite %{page_input} von %{pages}</label>"
21
- items_selector_js: "<label>Zeige %{items_input} %{item_name} pro Seite</label>"
18
+ single_page: "Zeige %{count} %{item_name}"
19
+ multiple_pages: "Zeige %{item_name} %{from}-%{to} von %{count} gesamt"
20
+ combo_nav_js: "Seite %{page_input} von %{pages}"
21
+ items_selector_js: "Zeige %{items_input} %{item_name} pro Seite"