Skip to content

Commit

Permalink
moved script tags into header, undo slash modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
stoni committed Apr 6, 2012
1 parent ff15af6 commit 219e33b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/logstash/web/public/js/logstash.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
/* Check for history.pushState */

var display_query = query.replace("<", "&lt;").replace(">", "&gt;")
$("#querystatus, #results h1").html("Loading query '" + display_query + "' (offset:" + logstash.params.offset + ", count:" + logstash.params.count + ") <img class='throbber' src='media/throbber.gif'>")
$("#querystatus, #results h1").html("Loading query '" + display_query + "' (offset:" + logstash.params.offset + ", count:" + logstash.params.count + ") <img class='throbber' src='/media/throbber.gif'>")
//console.log(logstash.params)
logstash.params.q = query;

/* Load the search results */
$("#results").load("api/search?format=html", logstash.params,
$("#results").load("/api/search?format=html", logstash.params,
function(response, status, xhr) {
if (status == "error") {
/* We still return HTML on error, it's just an error message */
Expand Down Expand Up @@ -64,7 +64,7 @@
* This won't likely survive 1.0, but it's fun for now...
* TODO(sissel): Replace with a 'loading' or something icon. */

var throbber = $("<center><img src='media/throbber.gif'><center>")
var throbber = $("<center><img src='/media/throbber.gif'><center>")
throbber.attr("id", "throbber")
throbber.css("margin", "-100px");
$("#visual #throbber").remove();
Expand All @@ -73,7 +73,7 @@
tries = 4; /* default tries */
}

jQuery.getJSON("api/histogram", logstash.params, function(histogram, text, jqxhr) {
jQuery.getJSON("/api/histogram", logstash.params, function(histogram, text, jqxhr) {
/* Load the data into the graph */
var flot_data = [];
// histogram is an array of { "key": ..., "count": ... }
Expand Down Expand Up @@ -275,7 +275,7 @@
"<li>" +
"<b>(${type}) ${field}</b>:" +
"{{each(idx, val) value}}" +
"<a href='search?q=" + query + " ${escape(field)}:${$item.sanitize(val)}'" +
"<a href='/search?q=" + query + " ${escape(field)}:${$item.sanitize(val)}'" +
" data-field='${escape(field)}' data-value='${$item.sanitize(val)}'>" +
"${val}" +
"</a>, " +
Expand Down
12 changes: 6 additions & 6 deletions lib/logstash/web/views/layout.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
%link{ :rel => "stylesheet", :href => "/css/smoothness/jquery-ui-1.8.5.custom.css", :type => "text/css" }
%script{ :src => "/js/jquery-1.6.1.min.js", :type => "text/javascript" }
%script{ :src => "/js/jquery-ui-1.8.13.min.js", :type => "text/javascript" }
%script{ :src => "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js",
:type => "text/javascript" }
%script{ :src => "js/jquery.tmpl.min.js", :type => "text/javascript" }
%script{ :src => "js/jquery-hashchange-1.0.0.js", :type => "text/javascript" }
%script{ :src => "js/flot/jquery.flot.js", :type => "text/javascript" }
%script{ :src => "js/logstash.js", :type => "text/javascript" }

%body
#header
Expand All @@ -15,9 +21,3 @@
=yield
#footer

%script{ :src => "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js",
:type => "text/javascript" }
%script{ :src => "js/jquery.tmpl.min.js", :type => "text/javascript" }
%script{ :src => "js/jquery-hashchange-1.0.0.js", :type => "text/javascript" }
%script{ :src => "js/flot/jquery.flot.js", :type => "text/javascript" }
%script{ :src => "js/logstash.js", :type => "text/javascript" }

0 comments on commit 219e33b

Please sign in to comment.