clwiki 3.1.3 → 3.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/cl_wiki/shortcuts.js +20 -7
- data/app/views/cl_wiki/page/edit.html.erb +2 -0
- data/app/views/cl_wiki/page/find.html.erb +2 -0
- data/app/views/cl_wiki/page/recent.html.erb +3 -1
- data/app/views/cl_wiki/page/show.html.erb +3 -1
- data/app/views/layouts/cl_wiki/application.html.erb +1 -1
- data/lib/cl_wiki/page.rb +10 -6
- data/lib/cl_wiki/version.rb +1 -1
- data/test/dummy/log/development.log +857 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/05/05U3nfNxrXRsqvbY0FPdE4JJ34O04u3OYRMiNSsSd2U.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/09/09RB5CdPnRT7YC7_DG_XoRaLSpiJ0GlOH6knOkQkUo4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/1n/1nPT8txF9k-opf1dt28LkyoNOAlggHQesiYDvlCEVmQ.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/2A/2AzOvZfD_jYRqSBY29p-2cORsUcKmOfaq_38rWRfEjE.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/4-/4-BfRACTK6aXqpi830uiN-QNvgPwbixbE9nXM05TxUk.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/4_/4_wkhRjt0QVRoLVmsXNi4IEUeDiH08UX7efec-F4fYw.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/6B/6BvKDKEIrocAfhwJU6z7mndgYE2E7Dpp6E5gaR0yYvk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/7a/7a_VMKQuKo9q_d3UHXIPSCB7dMre79Z8YkU11YklKoY.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/AH/AHLFtMsaZIwQ9D7HfZOQ_wPQN6hBufktyQvGW9TKGgk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/BQ/bqKSqZNgRPYNmUhKLdqlMv-3ohwmHwlv1TtmR_zSfL0.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/CY/CYd_T0Mvsv0u_iIAhbkRe7Wi2P5GKYoZ6AoMPeK5Z5c.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Fo/Fo--qUNG1V_CyADMhU5vH86pJnx1m2d-k2qaPAjXBIQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/Gw/GWwA-JgBnAGHqassR-NZ_iatnnmcVDaBtfI9uAW12CI.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/I7/I7KyprvSwemyBLH7tmm82My-j0czehx3QD84naPwErU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/LT/LTH3NeNw8IFVbydk839Ob0XiwEQZtIyixMltWtIzg5o.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/O4/o4XO8Qo3fNsMwcTk5-pEF4_buoB_KtsqHF1HzpJrvHY.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/OV/ovgywySuV5Tfoz9t5e75MyUdHMAH8-tCpbiERJpI17I.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/WH/WHjGFRPXuo5lOzRP-4ecNErP9JyVXBqeTUqheALqmFE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/WZ/WZBILEsCv3gfXqzu7AlVz6-c0WlVID5rmTWc2mkwef8.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/YB/ybfb2NUYWF4r8SWqemYRZCheTxFxljytKX_ZzDG9Cao.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/_F/_f5XKF_5JYLUPPJJLJ1l5UbghZsyKIZ4Pro7Tlh1bKw.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/d9/d9n-22PYG-8MqJicPbbJ2r3ip0cFQeugk5HtU-5ueZ4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/db/dBIMLCZq8Y4TneD8CzU_5XvyC361SZGR0gNEvsUFvTc.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/do/doeYUKrK0jpgmu8QFGRN5oaanpBO1bfAMfZoUu9fzkA.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/f2/f2U7Jaa67dTPefREUU-gUKLmCAmL8K3g-quaZL2hlMU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/hv/HvGUR1YSVraG2rlOgzyLGRjtcjsvT_nPwL9bu1MDT2s.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/jM/jMuaKlFw9chBDcGV_09Gq063OSWFfvF8nyJPFvB7cCc.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/pA/PaWZ-fSLvbCy3iBNmjPOgLSdaF6Yzpf5UH8C_NNywsE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/rD/rDXlwIJ2QsZfT3ZaxA1c3KzxowRPN1AXbkycmPBzTKs.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/sh/SHzYooqr9p4JBI5xqicitaryaroAdKmATarDQRLxmTA.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/vh/vhQ4BTVt1aVRwAo6Vmm18VR5ag7FJSKAdA6_ON-BzN0.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/xt/xTF89fxfBL2O3D3oJAG-Umx68WUgcpCHVnk6P3tMagE.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v4.0.0/z4/z4nGWAyv5nfOdl3HYCnII81-DMIu5-3pClB-iDVnDgE.cache +0 -0
- metadata +68 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1975a9e3a84db8cc346f59c0a7aaf4f939c5c1258daa412b334ff141de7064d
|
4
|
+
data.tar.gz: dc58f70d9676c805b0b8a102be3566c01e27d56c25d4d75a087c0ade31ab4ed6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a367e719902afa6212605f5b7096f4a6f18328a3a4a12b0de0d023d081d5ece9dcfa721ef9eabe7e464e63e71dfac4bbc3340fd5ea8fce059e9285eec47b18d0
|
7
|
+
data.tar.gz: 6a6047ee69812183548c3480fc436b0642714aa88112bc9187853d3d15d0fe7b953d90eb89d4bcdebfc14d64a19622b81383dc2a86ed616ae977d94a1a7ea987
|
@@ -1,23 +1,36 @@
|
|
1
|
-
function
|
1
|
+
function navigateToPage(page) {
|
2
2
|
let url = new URL(window.location.href).href;
|
3
|
-
window.location.href = url.substring(0, url.lastIndexOf('/')) + '/
|
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
|
-
|
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
|
20
|
-
|
32
|
+
} else {
|
33
|
+
commonShortcuts(e);
|
21
34
|
}
|
22
35
|
}
|
23
36
|
});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
<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
|
-
|
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
|
-
|
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
|
data/lib/cl_wiki/version.rb
CHANGED