diff --git a/public/javascripts/app.js b/public/javascripts/app.js index 15aa7cb..c21c830 100644 --- a/public/javascripts/app.js +++ b/public/javascripts/app.js @@ -11,25 +11,19 @@ var Search = { resultsId : 'results', search_fields: [ 'term1', 'term2', 'term3' ], // domIds of search term fields file_list : 'file-list', // domId of select for logfiles - logfiles : {}, // hash of log files past_params : null, // recent request url : '/perform', scroll_fnId : null, // initialize Search form - // { 'grep': [ log, files, for, grep], 'tail': [ 'log', 'files', 'for', 'tail']} - init: function(logfiles, params) { - this.logfiles = logfiles; + init: function(params) { this.past_params = params; - - this.bind_grep_tool(); - this.bind_tail_tool(); this.bind_options(); if (!this.past_params) return; // return if no prev settings, nothing to set // init tool selector - (this.past_params['tool'] == 'grep') ? $('#grep-label').trigger('click') : $('#tail-tool').trigger('click'); + (this.past_params['tool'] == 'grep') ? $('#grep-tool').attr('checked', 'checked') : $('#tail-tool').attr('checked', 'checked'); // init log file selector $('#'+this.file_list).val(this.past_params['file']); @@ -61,38 +55,6 @@ var Search = { $('#auto-scroll').attr('checked', true).trigger('change'); // by default, turn on }, - // bind change grep tool - bind_grep_tool: function() { - $('#grep-tool').bind('change', function(e){ - var newlist = "" - jQuery.each(Search.logfiles['grep'], function(){ - newlist += "\n" - }); - $('#'+Search.file_list).html(newlist); - }); - // watch clicking label as well - $('#grep-label').bind('click', function(e){ - $('#grep-tool').attr('checked', 'checked').val('grep').trigger('change'); - }); - }, - - - // bind change tail tool - bind_tail_tool: function() { - $('#tail-tool').bind('change', function(e){ - var newlist = "" - jQuery.each(Search.logfiles['tail'], function(){ - newlist += "\n" - }); - $('#'+ Search.file_list).html(newlist); - }); - // watch clicking label as well - $('#tail-label').bind('click', function(e){ - $('#tail-tool').attr('checked', 'checked').val('tail').trigger('change'); - }); - }, - - // clears the terms fields clear: function() { jQuery.each(this.search_fields, function(){ diff --git a/public/stylesheets/app.css b/public/stylesheets/app.css index a7ab392..d3a373d 100644 --- a/public/stylesheets/app.css +++ b/public/stylesheets/app.css @@ -36,7 +36,7 @@ table.actions th { font-size: 11px; color: #333; text-align: left; min-width: 10 table.actions td { padding: 2px 5px; text-align: left; vertical-align: middle;} table.actions span.note { font-weight: normal; color: #999; } table.actions span.and { font-size: 11px; color: red; font-weight: bold; } -table.actions span.label { font-weight: bold; cursor:pointer;} +table.actions label { font-weight: bold; cursor:pointer;} table.actions input[type=text] { width: 200px; padding: 2px; border: 1px solid #aaa;} diff --git a/views/_toolbar.html.erb b/views/_toolbar.html.erb index feb344f..0245c9d 100644 --- a/views/_toolbar.html.erb +++ b/views/_toolbar.html.erb @@ -16,8 +16,8 @@ - Search
- Tail
+
+