wacky 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
$ ->
|
2
|
+
helpContainer = ->
|
3
|
+
$('.wacky-keyboard-commands')
|
4
|
+
|
5
|
+
eKeyPressed = (e) ->
|
6
|
+
e.which == 69
|
7
|
+
|
8
|
+
vKeyPressed = (e) ->
|
9
|
+
e.which == 86
|
10
|
+
|
11
|
+
questionMarkPressed = (e) ->
|
12
|
+
e.shiftKey && e.which == 191
|
13
|
+
|
14
|
+
escPressed = (e) ->
|
15
|
+
e.which == 27
|
16
|
+
|
17
|
+
goToEditPage = ->
|
18
|
+
if editPageLink()
|
19
|
+
window.location = editPageLink().href
|
20
|
+
|
21
|
+
goToPageVersions = ->
|
22
|
+
if pageVersionsLink()
|
23
|
+
window.location = pageVersionsLink().href
|
24
|
+
|
25
|
+
editPageLink = ->
|
26
|
+
$('a[rel=edit-page]')[0]
|
27
|
+
|
28
|
+
pageVersionsLink = ->
|
29
|
+
$('a[rel=page-versions]')[0]
|
30
|
+
|
31
|
+
showHelp = ->
|
32
|
+
helpContainer().show()
|
33
|
+
|
34
|
+
hideHelp = ->
|
35
|
+
helpContainer().hide()
|
36
|
+
|
37
|
+
$(window).on 'keyup', (e) ->
|
38
|
+
if eKeyPressed(e)
|
39
|
+
goToEditPage()
|
40
|
+
if vKeyPressed(e)
|
41
|
+
goToPageVersions()
|
42
|
+
if escPressed(e)
|
43
|
+
hideHelp()
|
44
|
+
|
45
|
+
$(window).on 'keydown', (e) ->
|
46
|
+
if questionMarkPressed(e)
|
47
|
+
showHelp()
|
48
|
+
|
49
|
+
hideHelp()
|
@@ -1,5 +1,7 @@
|
|
1
|
+
= render 'help'
|
2
|
+
|
1
3
|
= @page.to_html.html_safe
|
2
4
|
|
3
5
|
ul.actions
|
4
|
-
li= link_to "Edit", edit_page_path(@page)
|
5
|
-
li= link_to "Versions", versions_page_path(@page)
|
6
|
+
li= link_to "Edit", edit_page_path(@page), rel: 'edit-page'
|
7
|
+
li= link_to "Versions", versions_page_path(@page), rel: 'page-versions'
|
data/lib/wacky/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wacky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -356,6 +356,7 @@ extra_rdoc_files: []
|
|
356
356
|
files:
|
357
357
|
- app/views/layouts/wacky/application.html.slim
|
358
358
|
- app/views/wacky/special_pages/recently_updated.html.slim
|
359
|
+
- app/views/wacky/pages/_help.html.slim
|
359
360
|
- app/views/wacky/pages/versions.html.slim
|
360
361
|
- app/views/wacky/pages/new.html.slim
|
361
362
|
- app/views/wacky/pages/version.html.slim
|
@@ -365,9 +366,11 @@ files:
|
|
365
366
|
- app/models/wacky/extracts_title.rb
|
366
367
|
- app/assets/javascripts/wacky/ace.js
|
367
368
|
- app/assets/javascripts/wacky/showdown.js
|
369
|
+
- app/assets/javascripts/wacky/keyboard.js.coffee
|
368
370
|
- app/assets/javascripts/wacky/application.js
|
369
371
|
- app/assets/stylesheets/wacky/ace.css.scss
|
370
372
|
- app/assets/stylesheets/wacky/application.css
|
373
|
+
- app/assets/stylesheets/wacky/help.css.scss
|
371
374
|
- app/controllers/wacky/special_pages_controller.rb
|
372
375
|
- app/controllers/wacky/application_controller.rb
|
373
376
|
- app/controllers/wacky/pages_controller.rb
|