From dd2d3df9f57b28998e97545b9cfa1078b94f0320 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Thu, 29 Oct 2015 17:42:22 +0100 Subject: debug view ajax --- js/debug.js | 14 ++++++++++++++ views/debug.haml | 13 ++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 js/debug.js diff --git a/js/debug.js b/js/debug.js new file mode 100644 index 0000000..d69dd2b --- /dev/null +++ b/js/debug.js @@ -0,0 +1,14 @@ +$().ready(function() +{ + $(".ajax").each(function(x){ + $(this).click(function(){ + $.ajax({url: $(this).attr("tgt"), success: function(result){ + $("#ajax_result").html(result); + }}); + }) + }) +}) + +$("#reset").click(function(){ + +}); diff --git a/views/debug.haml b/views/debug.haml index e71f736..5ca709c 100644 --- a/views/debug.haml +++ b/views/debug.haml @@ -4,6 +4,8 @@ %head %title debug view (session ##{session_key}) %link(rel="stylesheet" type="text/css" href="debug.css") + %script{:src =>"http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js", :charset=>"utf-8"} + %script{:src => "http://coltrane.cl.uni-heidelberg.de/lfpe/js/debug.js"} %body %h1 debug view %h2 session ##{session_key} @@ -12,15 +14,16 @@ %strong No data to show! %ul %li - %a{:href => "/reset", :target => "_blank"} reset progress + %a.ajax{:tgt => "/reset", :href => "#"} reset progress %li - %a{:href => "/reset_weights", :target => "_blank"} reset weights + %a.ajax{:tgt => "/reset_weights", :href => "#"} reset weights %li - %a{:href => "/reset_extractor", :target => "_blank"} reset extractor + %a.ajax{:tgt => "/reset_extractor", :href => "#"} reset extractor %li - %a{:href => "/reset_add_rules", :target => "_blank"} reset add. rules + %a.ajax{:tgt => "/reset_add_rules", :href => "#"} reset add. rules %li - %a{:href => "/shutdown", :target => "_blank"} shutdown + %a.ajax{:tgt => "/shutdown", :href => "#"} shutdown + %p#ajax_result %p %strong learning rate: %select -- cgit v1.2.3