Commit 8260f5ecec88c8acabf6c4b65d7fd225446895e4
Committed by
Paulo Meireles
1 parent
5f36bd63
Exists in
staging
and in
42 other branches
adding new javascript for ajax result
Showing
3 changed files
with
16 additions
and
2 deletions
Show diff stats
plugins/mezuro/lib/mezuro_plugin.rb
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | +function results($) { | |
| 2 | + $('.mezuro-display-metrics').click(function() { | |
| 3 | + var profile = 'qt-calculator'; // FIXME | |
| 4 | + var project = $('#module-result').attr('data-project-id'); | |
| 5 | + var module_name = $(this).attr('data-module-name'); | |
| 6 | + var endpoint = '/profile/' + profile + '/plugins/mezuro/metrics/' + project; | |
| 7 | + // FIXME turn on the 'loading ...' | |
| 8 | + $.get(endpoint, { module_name: module_name }, function(content) { | |
| 9 | + $('#module-result').html(content); | |
| 10 | + // FIXME turn off the 'loading ...' | |
| 11 | + }); | |
| 12 | + return false; | |
| 13 | + }); | |
| 14 | +}; | |
| 0 | 15 | \ No newline at end of file | ... | ... |
plugins/mezuro/test/unit/mezuro_plugin_test.rb
| ... | ... | @@ -26,7 +26,7 @@ class MezuroPluginTest < Test::Unit::TestCase |
| 26 | 26 | end |
| 27 | 27 | |
| 28 | 28 | should 'list javascript files' do |
| 29 | - assert_equal 'javascripts/toogle.js', @plugin.js_files | |
| 29 | + assert_equal ['javascripts/results.js', 'javascripts/toogle.js'], @plugin.js_files | |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | 32 | end |
| 33 | 33 | \ No newline at end of file | ... | ... |