From 8e0013d0df56f8f379e56e78244fb31e2fac2c80 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Thu, 27 Jun 2013 22:47:34 +0200 Subject: [PATCH] add shortcuts, help dialog and start on add-action dialog --- app/assets/javascripts/application.js | 1 + app/assets/javascripts/keybindings.js.coffee | 12 ++++++++++ app/assets/javascripts/tracks.js.coffee | 7 +++++- app/views/layouts/application.html.erb | 6 +++-- app/views/shared/_add_new_action.html.erb | 17 ++++++++++++++ app/views/shared/_keyboard_shortcuts.html.erb | 23 +++++++++++++++++++ app/views/sidebar/sidebar.html.erb | 7 ------ 7 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 app/views/shared/_add_new_action.html.erb create mode 100644 app/views/shared/_keyboard_shortcuts.html.erb delete mode 100644 app/views/sidebar/sidebar.html.erb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 6a34daf7..29e3bcf7 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -17,6 +17,7 @@ // Stuff in app/assets //= require tracks.js +//= require keybindings.js // Stuff in vendor/assets // require jquery-ui-1.10.0.custom.min diff --git a/app/assets/javascripts/keybindings.js.coffee b/app/assets/javascripts/keybindings.js.coffee index 70b3838e..26a25eda 100644 --- a/app/assets/javascripts/keybindings.js.coffee +++ b/app/assets/javascripts/keybindings.js.coffee @@ -41,3 +41,15 @@ $ -> mouseTrapRails.toggleHints() if mouseTrapRails.showOnLoad + Mousetrap.bind '?', -> $('div#tracks-shortcuts-dialog').modal() + Mousetrap.bind 'a', -> $('div#tracks-add-action-dialog').modal() + # GO TO + # Mousetrap.bind 'g h', TracksApp.go_home + Mousetrap.bind 'g c', -> alert("go context") + # Mousetrap.bind 'g C', TracksApp.go_contexts + Mousetrap.bind 'g t', -> alert("go tag") + Mousetrap.bind 'g p', -> alert("go project") + # Mousetrap.bind 'g P', TracksApp.go_projects + # VIEW + Mousetrap.bind 'v p', -> alert("group by project") + Mousetrap.bind 'v c', -> alert("group by context") diff --git a/app/assets/javascripts/tracks.js.coffee b/app/assets/javascripts/tracks.js.coffee index 83a51236..ef577c9e 100644 --- a/app/assets/javascripts/tracks.js.coffee +++ b/app/assets/javascripts/tracks.js.coffee @@ -1 +1,6 @@ -# Tracks specific coffeescript \ No newline at end of file +# Tracks specific coffeescript +# TracksApp = +# goto_page: (page) -> window.location.href = page +# go_home: this.goto_page "/" +# go_contexts: this.goto_page "/contexts" +# go_projects: this.goto_page "/projects" \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b2b2e16f..780dd674 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -40,7 +40,7 @@
-
+
<%= bootstrap_flash %> <%= yield %>
@@ -48,7 +48,9 @@
<%= render partial: "shared/footer" %> - + <% # dialogs -%> + <%= render partial: "shared/keyboard_shortcuts" %> + <%= render partial: "shared/add_new_action" %> <% # Javascripts # ================================================== diff --git a/app/views/shared/_add_new_action.html.erb b/app/views/shared/_add_new_action.html.erb new file mode 100644 index 00000000..0544379b --- /dev/null +++ b/app/views/shared/_add_new_action.html.erb @@ -0,0 +1,17 @@ +` \ No newline at end of file diff --git a/app/views/shared/_keyboard_shortcuts.html.erb b/app/views/shared/_keyboard_shortcuts.html.erb new file mode 100644 index 00000000..1a386ecc --- /dev/null +++ b/app/views/shared/_keyboard_shortcuts.html.erb @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/app/views/sidebar/sidebar.html.erb b/app/views/sidebar/sidebar.html.erb deleted file mode 100644 index 173aa882..00000000 --- a/app/views/sidebar/sidebar.html.erb +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file