plugins/help/views/index.html.erb in redcar-0.11.0dev vs plugins/help/views/index.html.erb in redcar-0.11

- old
+ new

@@ -1,10 +1,19 @@ <html> <head> <title>Keyboard Shortcuts</title> <% redcar_css = File.expand_path(File.join(Redcar.root, %w(plugins help views default.css))) %> <link rel="stylesheet" href="file://<%= redcar_css %>" type="text/css" media="screen"> + <%= javascript_controller_actions %> + <script type="text/javascript" src="file://<%= Redcar::HtmlView.jquery_path %>"></script> + <script> + function addKeyBinding(command) { + var key = prompt("Key for " + command, ""); + Controller.addKeyBinding(key, command); + window.location.href = "controller/index"; + } + </script> </head> <body> <h1>Keyboard Shortcuts</h1> <div class="content"> <div class="refresh"> @@ -16,10 +25,10 @@ <th>Shortcut</th> </tr> <% i = 0 %> <% Redcar.app.main_keymap.map.sort_by{|key, command| clean_name(command)}.each do |key, command| %> <tr class="<%= i % 2 == 0 ? 'even':'odd'%>"> - <td><%= clean_name(command) %></td> + <td><a href="javascript:addKeyBinding('<%=command %>');"><%= clean_name(command) %></a></td> <td><%= key %></td> <% i = i + 1%> </tr> <% end %> </table> \ No newline at end of file