Module: UatDirector::Helpers

Defined in:
lib/uat_director/helpers.rb

Instance Method Summary collapse

Instance Method Details

#toolbar_htmlObject



32
33
34
# File 'lib/uat_director/helpers.rb', line 32

def toolbar_html
  "<div id='uat-bar'><a class='go' href='#'>Show me what to test</a><div class='pop-over hide'><a class='close' href='#'>close</a></div></div>"
end

#uat_directorObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/uat_director/helpers.rb', line 3

def uat_director
<<TDSCRIPT
<script type="text/javascript">
  $("body").prepend("#{toolbar_html}");
  $("#uat-bar").css({width: "100%", background: "#000", "text-align": "right"});
  $("#uat-bar a.go").css({color: "#fff"});
  $("#uat-bar .pop-over").css({position: "absolute", right: "0px", clear: "none", "z-index": "99999999", background: "#fff", "text-align": "left"});
  $("#uat-bar .hide").css({display: "none"});
  $(function() {
$("#uat-bar a.go").click(function() {
  $.ajax({
    url: '/uat_director',
    success: function(response) {
      $(".pop-over").append(response); 
      $(".pop-over").slideDown();
    }
  });
});

$("#uat-bar a.close").click(function() {
  $(".pop-over").slideUp(function() {
    $(".pop-over ol").remove();
  });
});
  });
</script>
TDSCRIPT
end