summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-10-29 17:42:22 +0100
committerPatrick Simianer <p@simianer.de>2015-10-29 17:42:22 +0100
commitdd2d3df9f57b28998e97545b9cfa1078b94f0320 (patch)
treece125a5308936eedfa98baa9fc3db37d2c21c9de
parentf9cbbc92f79c85d088d4847d9beb1acf608e7d07 (diff)
debug view ajax
-rw-r--r--js/debug.js14
-rw-r--r--views/debug.haml13
2 files changed, 22 insertions, 5 deletions
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