clwiki 3.1.3 → 3.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/cl_wiki/shortcuts.js +20 -7
  3. data/app/views/cl_wiki/page/edit.html.erb +2 -0
  4. data/app/views/cl_wiki/page/find.html.erb +2 -0
  5. data/app/views/cl_wiki/page/recent.html.erb +3 -1
  6. data/app/views/cl_wiki/page/show.html.erb +3 -1
  7. data/app/views/layouts/cl_wiki/application.html.erb +1 -1
  8. data/lib/cl_wiki/page.rb +10 -6
  9. data/lib/cl_wiki/version.rb +1 -1
  10. data/test/dummy/log/development.log +857 -0
  11. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/05/05U3nfNxrXRsqvbY0FPdE4JJ34O04u3OYRMiNSsSd2U.cache +1 -0
  12. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/09/09RB5CdPnRT7YC7_DG_XoRaLSpiJ0GlOH6knOkQkUo4.cache +1 -0
  13. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/1n/1nPT8txF9k-opf1dt28LkyoNOAlggHQesiYDvlCEVmQ.cache +2 -0
  14. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/2A/2AzOvZfD_jYRqSBY29p-2cORsUcKmOfaq_38rWRfEjE.cache +3 -0
  15. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/4-/4-BfRACTK6aXqpi830uiN-QNvgPwbixbE9nXM05TxUk.cache +1 -0
  16. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/4_/4_wkhRjt0QVRoLVmsXNi4IEUeDiH08UX7efec-F4fYw.cache +2 -0
  17. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/6B/6BvKDKEIrocAfhwJU6z7mndgYE2E7Dpp6E5gaR0yYvk.cache +0 -0
  18. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/7a/7a_VMKQuKo9q_d3UHXIPSCB7dMre79Z8YkU11YklKoY.cache +1 -0
  19. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/AH/AHLFtMsaZIwQ9D7HfZOQ_wPQN6hBufktyQvGW9TKGgk.cache +0 -0
  20. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/BQ/bqKSqZNgRPYNmUhKLdqlMv-3ohwmHwlv1TtmR_zSfL0.cache +0 -0
  21. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/CY/CYd_T0Mvsv0u_iIAhbkRe7Wi2P5GKYoZ6AoMPeK5Z5c.cache +0 -0
  22. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Fo/Fo--qUNG1V_CyADMhU5vH86pJnx1m2d-k2qaPAjXBIQ.cache +1 -0
  23. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Gw/GWwA-JgBnAGHqassR-NZ_iatnnmcVDaBtfI9uAW12CI.cache +1 -0
  24. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/I7/I7KyprvSwemyBLH7tmm82My-j0czehx3QD84naPwErU.cache +0 -0
  25. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/LT/LTH3NeNw8IFVbydk839Ob0XiwEQZtIyixMltWtIzg5o.cache +0 -0
  26. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/O4/o4XO8Qo3fNsMwcTk5-pEF4_buoB_KtsqHF1HzpJrvHY.cache +1 -0
  27. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/OV/ovgywySuV5Tfoz9t5e75MyUdHMAH8-tCpbiERJpI17I.cache +1 -0
  28. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/WH/WHjGFRPXuo5lOzRP-4ecNErP9JyVXBqeTUqheALqmFE.cache +0 -0
  29. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/WZ/WZBILEsCv3gfXqzu7AlVz6-c0WlVID5rmTWc2mkwef8.cache +0 -0
  30. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/YB/ybfb2NUYWF4r8SWqemYRZCheTxFxljytKX_ZzDG9Cao.cache +1 -0
  31. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/_F/_f5XKF_5JYLUPPJJLJ1l5UbghZsyKIZ4Pro7Tlh1bKw.cache +0 -0
  32. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/d9/d9n-22PYG-8MqJicPbbJ2r3ip0cFQeugk5HtU-5ueZ4.cache +1 -0
  33. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/db/dBIMLCZq8Y4TneD8CzU_5XvyC361SZGR0gNEvsUFvTc.cache +1 -0
  34. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/do/doeYUKrK0jpgmu8QFGRN5oaanpBO1bfAMfZoUu9fzkA.cache +1 -0
  35. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/f2/f2U7Jaa67dTPefREUU-gUKLmCAmL8K3g-quaZL2hlMU.cache +1 -0
  36. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/hv/HvGUR1YSVraG2rlOgzyLGRjtcjsvT_nPwL9bu1MDT2s.cache +0 -0
  37. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/jM/jMuaKlFw9chBDcGV_09Gq063OSWFfvF8nyJPFvB7cCc.cache +1 -0
  38. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/pA/PaWZ-fSLvbCy3iBNmjPOgLSdaF6Yzpf5UH8C_NNywsE.cache +1 -0
  39. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/rD/rDXlwIJ2QsZfT3ZaxA1c3KzxowRPN1AXbkycmPBzTKs.cache +3 -0
  40. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/sh/SHzYooqr9p4JBI5xqicitaryaroAdKmATarDQRLxmTA.cache +0 -0
  41. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/vh/vhQ4BTVt1aVRwAo6Vmm18VR5ag7FJSKAdA6_ON-BzN0.cache +0 -0
  42. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/xt/xTF89fxfBL2O3D3oJAG-Umx68WUgcpCHVnk6P3tMagE.cache +3 -0
  43. data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/z4/z4nGWAyv5nfOdl3HYCnII81-DMIu5-3pClB-iDVnDgE.cache +0 -0
  44. metadata +68 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba18a20142df92b4c3fd21dd47012b5048d79b0a3ca8051bca67e6f782ffb3b3
4
- data.tar.gz: 9c0ad39b9dca596e9f78424fdeef2725af33c390cc74dac0bb7e89c2f944ac85
3
+ metadata.gz: f1975a9e3a84db8cc346f59c0a7aaf4f939c5c1258daa412b334ff141de7064d
4
+ data.tar.gz: dc58f70d9676c805b0b8a102be3566c01e27d56c25d4d75a087c0ade31ab4ed6
5
5
  SHA512:
6
- metadata.gz: db9f7b6a687f3a185e3dfb88eb8097995bcb5f3e41e9a3d84ead8070006c1e445270045758c2db6303e43457b0e1d3fc24ff79dda5ef1c7728b0cefb0443c487
7
- data.tar.gz: a75d19504fdd4e44cd0d3a8d37363d28dbfa805de30b6d4d911309f213b8b50cbdab6634ef0be3dfb4fb128b2146f2447bf87d56a015532dd7c1ff12f584472b
6
+ metadata.gz: a367e719902afa6212605f5b7096f4a6f18328a3a4a12b0de0d023d081d5ece9dcfa721ef9eabe7e464e63e71dfac4bbc3340fd5ea8fce059e9285eec47b18d0
7
+ data.tar.gz: 6a6047ee69812183548c3480fc436b0642714aa88112bc9187853d3d15d0fe7b953d90eb89d4bcdebfc14d64a19622b81383dc2a86ed616ae977d94a1a7ea987
@@ -1,23 +1,36 @@
1
- function navigateToFind() {
1
+ function navigateToPage(page) {
2
2
  let url = new URL(window.location.href).href;
3
- window.location.href = url.substring(0, url.lastIndexOf('/')) + '/find';
3
+ window.location.href = url.substring(0, url.lastIndexOf('/')) + '/' + page;
4
+ }
5
+
6
+ function commonShortcuts(e) {
7
+ if (e.key === "f") {
8
+ navigateToPage('find');
9
+ } else if (e.key === "h") {
10
+ navigateToPage('FrontPage');
11
+ } else if (e.key === "r") {
12
+ navigateToPage('recent');
13
+ }
4
14
  }
5
15
 
6
16
  $(document).keydown(function (e) {
17
+ const anyModifiers = (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey);
18
+ if (anyModifiers) {
19
+ return;
20
+ }
21
+
7
22
  if (window.location.href.endsWith("/edit")) {
8
23
  } else if (window.location.href.endsWith("/find")) {
9
24
  } else if (window.location.href.endsWith("/login")) {
10
25
  // this is important otherwise typing `e` while logging in refreshes the
11
26
  // page - doh!
12
27
  } else if (window.location.href.endsWith("/recent")) {
13
- if (e.key === "f") {
14
- navigateToFind();
15
- }
28
+ commonShortcuts(e);
16
29
  } else {
17
30
  if (e.key === "e") {
18
31
  window.location.href = window.location.href + "/edit";
19
- } else if (e.key === "f") {
20
- navigateToFind();
32
+ } else {
33
+ commonShortcuts(e);
21
34
  }
22
35
  }
23
36
  });
@@ -1,3 +1,5 @@
1
+ <% content_for :title, "ClWiki: #{@page.name} (edit)" %>
2
+
1
3
  <%= form_tag(page_show_path(:page_name => @page.page_name)) do %>
2
4
  <%= hidden_field_tag 'client_mod_time', @page.mtime.to_i.to_s %>
3
5
 
@@ -1,3 +1,5 @@
1
+ <% content_for :title, "ClWiki: Find" %>
2
+
1
3
  <%= @formatter.header("Find").html_safe %>
2
4
 
3
5
  <div class='findInput'>
@@ -1,6 +1,8 @@
1
+ <% content_for :title, "ClWiki: Recent" %>
2
+
1
3
  <% @pages.each do |page| %>
2
4
  <div class='wikiHeader'>
3
5
  <span class='pageName'><%= @formatter.convert_to_link(page.name).html_safe %></span>
4
6
  </div>
5
7
  <%= page.content.html_safe %>
6
- <% end %>
8
+ <% end %>
@@ -1 +1,3 @@
1
- <%= @page.content.html_safe %>
1
+ <% content_for :title, "ClWiki: #{@page.name}" %>
2
+
3
+ <%= @page.content.html_safe %>
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>ClWiki</title>
4
+ <title><%= yield(:title) %></title>
5
5
  <%= stylesheet_link_tag "cl_wiki/application", media: "all", "data-turbolinks-track" => true %>
6
6
  <%= javascript_include_tag "cl_wiki/application", "data-turbolinks-track" => true %>
7
7
  <%= csrf_meta_tags %>
data/lib/cl_wiki/page.rb CHANGED
@@ -6,7 +6,7 @@ require 'singleton'
6
6
  module ClWiki
7
7
  class Page
8
8
  attr_reader :content, :mtime, :name, :page_name, :raw_content,
9
- :file_full_path_and_name
9
+ :file_full_path_and_name
10
10
 
11
11
  def initialize(page_name, wiki_path: $wiki_conf.wiki_path, owner: PublicUser.new)
12
12
  raise "Fix this - no slashes! #{page_name}" if %r{/}.match?(page_name)
@@ -178,7 +178,7 @@ module ClWiki
178
178
  dirs = dirs[1..-1] if !dirs.empty? && dirs[0].empty?
179
179
  full_dirs = (0..dirs.length - 1).each { |i| full_dirs[i] = ('/' + dirs[0..i].join('/')) }
180
180
  head = String.new("<div class='wikiHeader'>")
181
- head << core_footer_links(full_page_name).sub('wikiFooter', 'wikiFooter wikiFooterFloat')
181
+ head << core_footer_links(full_page_name, -1).sub('wikiFooter', 'wikiFooter wikiFooterFloat')
182
182
  if [FIND_PAGE_NAME, FIND_RESULTS_NAME].include?(full_page_name)
183
183
  head << "<span class='pageName'>#{full_page_name}</span>"
184
184
  else
@@ -217,17 +217,21 @@ module ClWiki
217
217
  custom_footer << core_footer_links(page.page_name)
218
218
  end
219
219
 
220
- def core_footer_links(wiki_name)
220
+ def core_footer_links(wiki_name, tab_index=0)
221
221
  # refactor string constants
222
222
  footer = String.new("<div class='wikiFooter'>")
223
223
  footer << '<ul>'
224
224
  if $wiki_conf.editable
225
225
  unless [FIND_PAGE_NAME, FIND_RESULTS_NAME].include?(wiki_name)
226
- footer << "<li><span class='wikiAction'><a href='#{wiki_name}/edit'>Edit</a></span></li>"
226
+ footer << "<li><span class='wikiAction'><a href='#{wiki_name}/edit' tabindex=#{tab_index}>Edit</a></span></li>"
227
227
  end
228
228
  end
229
- footer << "<li><span class='wikiAction'><a href='find'>Find</a></span></li>"
230
- footer << "<li><span class='wikiAction'><a href='recent'>Recent</a></span></li>"
229
+ footer << "<li><span class='wikiAction'><a href='find' tabindex=#{tab_index}>Find</a></span></li>"
230
+ if $wiki_conf.publishTag
231
+ footer << "<li><span class='wikiAction'><a href='recent' tabindex=#{tab_index}>Recent</a></span></li>"
232
+ else
233
+ footer << "<li><span class='wikiAction'><a href='FrontPage' tabindex=#{tab_index}>Home</a></span></li>"
234
+ end
231
235
  footer << '</ul></div>'
232
236
  footer
233
237
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClWiki
4
- VERSION = '3.1.3'
4
+ VERSION = '3.1.4'
5
5
  end