| Remove ubaplyer (too buggy) - warvox - VoIP based wardialing tool, forked from … | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit d1ca9925b77d6c463f3e85de96b17e219f8f40cf | |
| parent 6fba0686fb93cf3157e42be1dff58a5b9cace5b0 | |
| Author: HD Moore <[email protected]> | |
| Date: Mon, 7 Jan 2013 03:27:01 -0600 | |
| Remove ubaplyer (too buggy) | |
| Diffstat: | |
| M Gemfile | 2 +- | |
| M Gemfile.lock | 31 ++++++++++-------------------… | |
| M app/assets/javascripts/application… | 1 - | |
| M app/assets/javascripts/dataTables.… | 9 ++++----- | |
| M app/assets/javascripts/dataTables_… | 1 + | |
| D app/assets/javascripts/jquery.ubap… | 223 ---------------------------… | |
| D app/assets/javascripts/jquery.ubap… | 5 ----- | |
| M app/assets/stylesheets/application… | 4 ++++ | |
| M app/assets/stylesheets/bootstrap_a… | 51 ---------------------------… | |
| M app/controllers/analyze_controller… | 90 +++++++++++++++++++++++----… | |
| M app/controllers/jobs_controller.rb | 5 ++++- | |
| M app/helpers/application_helper.rb | 30 +++--------------------------- | |
| M app/views/analyze/view.html.erb | 60 ++++++++++++++++-------------… | |
| M app/views/jobs/index.html.erb | 2 +- | |
| M app/views/jobs/results.html.erb | 4 ++-- | |
| M app/views/jobs/view_results.html.e… | 13 +++---------- | |
| M app/views/layouts/application.html… | 12 ------------ | |
| M app/views/shared/_audio_player.htm… | 1 - | |
| M app/views/shared/_call_info.html.e… | 7 ++++++- | |
| M lib/warvox/jobs/analysis.rb | 4 ++-- | |
| 20 files changed, 140 insertions(+), 415 deletions(-) | |
| --- | |
| diff --git a/Gemfile b/Gemfile | |
| @@ -31,7 +31,7 @@ gem 'formtastic' | |
| gem 'formtastic-bootstrap' | |
| gem 'rails_bootstrap_navbar' | |
| -gem "therubyracer", :group => :assets, :platform => :ruby | |
| +# gem "therubyracer", :group => :assets, :platform => :ruby | |
| gem 'will_paginate', '~> 3.0' | |
| gem 'will_paginate-bootstrap' | |
| diff --git a/Gemfile.lock b/Gemfile.lock | |
| @@ -1,6 +1,6 @@ | |
| GIT | |
| remote: git://github.com/dockyard/postgres_ext.git | |
| - revision: a0ac550ecc63f5413b31e808798443a7b7b250eb | |
| + revision: d114fea48bd27d7d35040b774e479058e3910566 | |
| specs: | |
| postgres_ext (0.1.0) | |
| activerecord (~> 3.2.0) | |
| @@ -37,9 +37,9 @@ GEM | |
| i18n (~> 0.6) | |
| multi_json (~> 1.0) | |
| arel (3.0.2) | |
| - authlogic (3.1.0) | |
| - activerecord (>= 3.0.7) | |
| - activerecord (>= 3.0.7) | |
| + authlogic (3.2.0) | |
| + activerecord (>= 3.0.0) | |
| + activesupport (>= 3.0.0) | |
| builder (3.0.4) | |
| coffee-rails (3.2.2) | |
| coffee-script (>= 2.2.0) | |
| @@ -48,7 +48,6 @@ GEM | |
| coffee-script-source | |
| execjs | |
| coffee-script-source (1.4.0) | |
| - commonjs (0.2.6) | |
| daemons (1.1.9) | |
| dynamic_form (1.1.4) | |
| erubis (2.7.0) | |
| @@ -63,18 +62,13 @@ GEM | |
| hike (1.2.1) | |
| i18n (0.6.1) | |
| journey (1.0.4) | |
| - jquery-datatables-rails (1.11.1) | |
| + jquery-datatables-rails (1.11.2) | |
| jquery-rails | |
| jquery-rails (2.1.4) | |
| railties (>= 3.0, < 5.0) | |
| thor (>= 0.14, < 2.0) | |
| - json (1.7.5) | |
| + json (1.7.6) | |
| kissfft (0.0.1) | |
| - less (2.2.2) | |
| - commonjs (~> 0.2.6) | |
| - less-rails (2.2.4) | |
| - actionpack (>= 3.1) | |
| - less (~> 2.2.0) | |
| librex (0.0.68) | |
| mail (2.4.4) | |
| i18n (>= 0.4.0) | |
| @@ -85,7 +79,7 @@ GEM | |
| pg (0.11.0) | |
| pg_array_parser (0.0.8) | |
| polyglot (0.3.3) | |
| - rack (1.4.1) | |
| + rack (1.4.2) | |
| rack-cache (1.2) | |
| rack (>= 0.4) | |
| rack-ssl (1.3.2) | |
| @@ -114,8 +108,7 @@ GEM | |
| rake (10.0.3) | |
| rdoc (3.12) | |
| json (~> 1.4) | |
| - ref (1.0.2) | |
| - sass (3.2.4) | |
| + sass (3.2.5) | |
| sass-rails (3.2.5) | |
| railties (~> 3.2.0) | |
| sass (>= 3.1.10) | |
| @@ -124,8 +117,6 @@ GEM | |
| hike (~> 1.2) | |
| rack (~> 1.0) | |
| tilt (~> 1.1, != 1.3.0) | |
| - therubyracer (0.11.0) | |
| - ref | |
| thin (1.5.0) | |
| daemons (>= 1.0.9) | |
| eventmachine (>= 0.12.6) | |
| @@ -135,11 +126,10 @@ GEM | |
| treetop (1.4.12) | |
| polyglot | |
| polyglot (>= 0.3.1) | |
| - twitter-bootstrap-rails (2.1.4) | |
| + twitter-bootstrap-rails (2.2.0) | |
| actionpack (>= 3.1) | |
| - less-rails (~> 2.2.3) | |
| + execjs | |
| railties (>= 3.1) | |
| - therubyracer (>= 0.10.2) | |
| tzinfo (0.3.35) | |
| uglifier (1.3.0) | |
| execjs (>= 0.3.0) | |
| @@ -167,7 +157,6 @@ DEPENDENCIES | |
| rails-settings-cached | |
| rails_bootstrap_navbar | |
| sass-rails (~> 3.2.3) | |
| - therubyracer | |
| thin | |
| twitter-bootstrap-rails | |
| uglifier (>= 1.0.3) | |
| diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/app… | |
| @@ -2,7 +2,6 @@ | |
| // This file is automatically included by javascript_include_tag :defaults | |
| //= require jquery | |
| //= require jquery_ujs | |
| -//= require jquery.ubaplayer | |
| //= require twitter/bootstrap | |
| //= require bootstrap-lightbox | |
| //= require dataTables/jquery.dataTables | |
| diff --git a/app/assets/javascripts/dataTables.fnReloadAjax.js b/app/assets/jav… | |
| @@ -20,18 +20,18 @@ jQuery.fn.dataTableExt.oApi.fnReloadAjax = function ( oSett… | |
| oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aDa… | |
| /* Clear the old information from the table */ | |
| that.oApi._fnClearTable( oSettings ); | |
| - | |
| + | |
| /* Got the data - add it to the table */ | |
| var aData = (oSettings.sAjaxDataProp !== "") ? | |
| that.oApi._fnGetObjectDataFn( oSettings.sAjaxDataProp )( json ) : json; | |
| - | |
| + | |
| for ( var i=0 ; i<aData.length ; i++ ) | |
| { | |
| that.oApi._fnAddData( oSettings, aData[i] ); | |
| } | |
| oSettings.aiDisplay = oSettings.aiDisplayMaster.slice(); | |
| - | |
| + | |
| if ( typeof bStandingRedraw != 'undefined' && bStandingRedraw === true ) | |
| { | |
| oSettings._iDisplayStart = iStart; | |
| @@ -50,4 +50,4 @@ jQuery.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettin… | |
| fnCallback( oSettings ); | |
| } | |
| }, oSettings ); | |
| -}; | |
| -\ No newline at end of file | |
| +}; | |
| diff --git a/app/assets/javascripts/dataTables_overrides.js b/app/assets/javasc… | |
| @@ -19,6 +19,7 @@ $.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings ) | |
| /* Bootstrap style pagination control */ | |
| $.extend( $.fn.dataTableExt.oPagination, { | |
| + | |
| "bootstrap": { | |
| "fnInit": function( oSettings, nPaging, fnDraw ) { | |
| var oLang = oSettings.oLanguage.oPaginate; | |
| diff --git a/app/assets/javascripts/jquery.ubaplayer.js b/app/assets/javascript… | |
| @@ -1,223 +0,0 @@ | |
| -/*! UbaPlayer - v1.0.1 - 2012-06-06 | |
| -* https://github.com/brianhadaway/UbaPlayer | |
| -* Copyright (c) 2012 Brian Hadaway; Licensed MIT, GPL */ | |
| - | |
| -(function($){ | |
| - var defaults = { | |
| - audioButtonClass: "audioButton", | |
| - autoPlay: null, | |
| - codecs: [{name:"OGG", codec: 'audio/ogg; codecs="vorbis… | |
| - continuous: false, | |
| - extension: null, | |
| - flashAudioPlayerPath: "libs/swf/player.swf", | |
| - flashExtension: ".mp3", | |
| - flashObjectID: "audioPlayer", | |
| - loadingClass: "loading", | |
| - loop: false, | |
| - playerContainer: "player", | |
| - playingClass: "playing", | |
| - swfobjectPath: "libs/swfobject/swfobject.js", | |
| - volume: 0.5 | |
| - }, | |
| - currentTrack, | |
| - isPlaying = false, | |
| - isFlash = false, | |
| - audio, | |
| - $buttons, | |
| - $tgt, | |
| - $el, | |
| - playTrack, | |
| - resumeTrack, | |
| - pauseTrack, | |
| - methods = { | |
| - play: function(element){ | |
| - $tgt = element; | |
| - currentTrack = _methods.getFileNameWithoutExtension($t… | |
| - isPlaying = true; | |
| - $tgt.addClass(defaults.loadingClass); | |
| - $buttons.removeClass(defaults.playingClass); | |
| - | |
| - if(isFlash){ | |
| - if(audio) { | |
| - _methods.removeListeners(window); | |
| - } | |
| - audio = document.getElementById(defaults.flash… | |
| - _methods.addListeners(window); | |
| - audio.playFlash(currentTrack + defaults.extens… | |
| - } else { | |
| - if(audio) { | |
| - audio.pause(); | |
| - _methods.removeListeners(audio); | |
| - } | |
| - audio = new Audio(""); | |
| - _methods.addListeners(audio); | |
| - audio.id = "audio"; | |
| - audio.loop = defaults.loop ? "loop" : ""; | |
| - audio.volume = defaults.volume; | |
| - audio.src = currentTrack + defaults.extension; | |
| - audio.play(); | |
| - } | |
| - }, | |
| - | |
| - pause: function(){ | |
| - if(isFlash){ | |
| - audio.pauseFlash(); | |
| - } else { | |
| - audio.pause(); | |
| - } | |
| - | |
| - $tgt.removeClass(defaults.playingClass); | |
| - isPlaying = false; | |
| - }, | |
| - | |
| - resume: function(){ | |
| - if(isFlash){ | |
| - audio.playFlash(); | |
| - } else { | |
| - audio.play(); | |
| - } | |
| - $tgt.addClass(defaults.playingClass); | |
| - isPlaying = true; | |
| - }, | |
| - | |
| - playing: function(){ | |
| - return isPlaying; | |
| - } | |
| - }, | |
| - | |
| - _methods = { | |
| - init: function( options ){ | |
| - var types; | |
| - | |
| - //set defaults | |
| - $.extend(defaults, options); | |
| - $el = this; | |
| - | |
| - //listen for clicks on the controls | |
| - $(".controls").bind("click",function(event){ | |
| - _methods.updateTrackState(event); | |
| - return false; | |
| - }); | |
| - $buttons = $("."+defaults.audioButtonClass); | |
| - | |
| - types = defaults.codecs; | |
| - for(var i = 0, ilen = types.length; i < ilen; i++){ | |
| - var type = types[i]; | |
| - if(_methods.canPlay(type)){ | |
| - defaults.extension = [".", type.name.t… | |
| - break; | |
| - } | |
| - } | |
| - | |
| - if(!defaults.extension || isFlash){ | |
| - isFlash = true; | |
| - defaults.extension = defaults.flashExtension; | |
| - } | |
| - | |
| - if(isFlash){ | |
| - $el.html("<div id='" + defaults.playerContaine… | |
| - $.getScript(defaults.swfobjectPath,function(){ | |
| - swfobject.embedSWF(defaults.flashAudio… | |
| - }); | |
| - } else { | |
| - if(defaults.autoPlay){ | |
| - methods.play(defaults.autoPlay); | |
| - } | |
| - } | |
| - }, | |
| - | |
| - updateTrackState: function( evt ){ | |
| - $tgt = $(evt.target); | |
| - if(!$tgt.hasClass("audioButton")){ | |
| - return; | |
| - } | |
| - if(!audio || (audio && currentTrack !== _methods.getFi… | |
| - methods.play($tgt); | |
| - } else if(!isPlaying) { | |
| - methods.resume(); | |
| - } else { | |
| - methods.pause(); | |
| - } | |
| - }, | |
| - | |
| - addListeners: function(elem) { | |
| - $(elem).bind({"canplay" : _methods.onLoaded, | |
| - "error" : _methods.onError, | |
| - "ended" : _methods.onEnded}); | |
| - }, | |
| - | |
| - removeListeners: function(elem) { | |
| - $(elem).unbind({"canplay" : _methods.onLoaded, | |
| - "error" : _methods.onError, | |
| - "ended" : _methods.onEnded}); | |
| - }, | |
| - | |
| - onLoaded: function () { | |
| - $buttons.removeClass(defaults.loadingClass); | |
| - $tgt.addClass(defaults.playingClass); | |
| - | |
| - audio.play(); | |
| - }, | |
| - | |
| - onError: function () { | |
| - $buttons.removeClass(defaults.loadingClass); | |
| - if(isFlash){ | |
| - _methods.removeListeners(window); | |
| - } else { | |
| - _methods.removeListeners(audio); | |
| - } | |
| - }, | |
| - | |
| - onEnded: function () { | |
| - isPlaying = false; | |
| - $tgt.removeClass(defaults.playingClass); | |
| - currentTrack = ""; | |
| - if(isFlash){ | |
| - _methods.removeListeners(window); | |
| - } else { | |
| - _methods.removeListeners(audio); | |
| - } | |
| - | |
| - if(defaults.continuous){ | |
| - var $next = $tgt.next().length ? $tgt.next() :… | |
| - methods.play($next); | |
| - } | |
| - | |
| - }, | |
| - | |
| - canPlay: function(type) { | |
| - if(!document.createElement("audio").canPlayType){ | |
| - return false; | |
| - } else { | |
| - return document.createElement("audio").canPlay… | |
| - } | |
| - }, | |
| - | |
| - swfLoaded: function(){ | |
| - if(defaults.autoPlay){ | |
| - setTimeout(function(){methods.play(defaults.au… | |
| - } | |
| - }, | |
| - | |
| - getFileNameWithoutExtension: function(fileName){ | |
| - //this function take a full file name and returns an e… | |
| - //ex. entering foo.mp3 returns foo | |
| - //ex. entering foo returns foo (no change) | |
| - | |
| - var fileNamePieces = fileName.split('.'); | |
| - fileNamePieces.pop(); | |
| - return fileNamePieces.join("."); | |
| - } | |
| - }; | |
| - | |
| - $.fn.ubaPlayer = function(method){ | |
| - if(methods[method]){ | |
| - return methods[method].apply(this, Array.prototype.sli… | |
| - } else if ( typeof method === "object" || ! method ) { | |
| - return _methods.init.apply( this, arguments ); | |
| - } else { | |
| - $.error( "Method " + method + " does not exist on jqu… | |
| - } | |
| - }; | |
| - | |
| -})(jQuery); | |
| diff --git a/app/assets/javascripts/jquery.ubaplayer.min.js b/app/assets/javasc… | |
| @@ -1,4 +0,0 @@ | |
| -/*! UbaPlayer - v1.0.1 - 2012-06-06 | |
| -* https://github.com/brianhadaway/UbaPlayer | |
| -* Copyright (c) 2012 Brian Hadaway; Licensed MIT, GPL */ | |
| -(function(a){var b={audioButtonClass:"audioButton",autoPlay:null,codecs:[{name… | |
| -\ No newline at end of file | |
| diff --git a/app/assets/stylesheets/application.css.scss.erb b/app/assets/style… | |
| @@ -48,6 +48,10 @@ table.list { | |
| } | |
| } | |
| +.dataTables_processing { | |
| + visibility: hidden; | |
| +} | |
| + | |
| .dataTables_info { | |
| font-size: 11px; | |
| font-color: #666666; | |
| diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/asse… | |
| @@ -65,57 +65,6 @@ body { | |
| } | |
| -// Start Ubaplayer | |
| -.audio-player { | |
| - list-style: none; | |
| - margin: 0; | |
| - padding: 0; | |
| -} | |
| - | |
| -#fallback { | |
| - display: none; | |
| -} | |
| - | |
| -.audioButton { | |
| - background: url("/assets/ubaplayer-btn.png") no-repeat 0 7px; | |
| - display: block; | |
| - cursor: pointer; | |
| - margin-left: 10px; | |
| - padding: 7px 10px 15px 25px; | |
| - color: @darkGray; | |
| - font-size: 18px; | |
| - font-weight: bold; | |
| -} | |
| - | |
| -.audioButton:hover { | |
| - background-position: 0 -33px; | |
| - color: @darkGray; | |
| - text-decoration: none; | |
| -} | |
| - | |
| -.audioButton.playing { | |
| - background-position: 0 -73px; | |
| - color: @darkGray; | |
| -} | |
| - | |
| -.audioButton.playing:hover { | |
| - background-position: 0 -113px; | |
| - color: @darkGray; | |
| -} | |
| - | |
| -.audioButton.loading, | |
| -.audioButton.loading:hover { | |
| - background: url("/assets/ubaplayer-loading.gif") no-repeat 0 7px; | |
| - text-indent: 0!important; | |
| -} | |
| - | |
| -#player { | |
| - display: none; | |
| -} | |
| - | |
| -// End of Ubaplayer | |
| - | |
| - | |
| .fwd_match_span { | |
| width: 100px; | |
| padding-left: 20px; | |
| diff --git a/app/controllers/analyze_controller.rb b/app/controllers/analyze_co… | |
| @@ -25,31 +25,34 @@ class AnalyzeController < ApplicationController | |
| @lines_by_type = res_types | |
| - if(@shown and @shown != 'all') | |
| - @results = Call.where(:job_id => @job_id).paginate( | |
| - :page => params[:page], | |
| - :order => 'number ASC', | |
| - :per_page => 10, | |
| - :conditions => [ 'answered = ? and analysis_completed_… | |
| - ) | |
| - else | |
| - @results = Call.where(:job_id => @job_id).paginate( | |
| - :page => params[:page], | |
| - :order => 'number ASC', | |
| - :per_page => 10, | |
| - :conditions => [ 'answered = ? and analysis_completed_… | |
| - ) | |
| - end | |
| - | |
| - @filters = [] | |
| - @filters << { :scope => "all", :label => "All" } | |
| - res_types.keys.each do |t| | |
| - @filters << { :scope => t.to_s.downcase, :label => t.to_s } | |
| - end | |
| + sort_by = params[:sort_by] || 'number' | |
| + sort_dir = params[:sort_dir] || 'asc' | |
| + | |
| + @results = [] | |
| + @results_total_count = @job.calls.where("job_id = ? AND analysis_completed… | |
| + | |
| + if request.format.json? | |
| + if params[:iDisplayLength] == '-1' | |
| + @results_per_page = nil | |
| + else | |
| + @results_per_page = (params[:iDisplayLength] || 20).to_i | |
| + end | |
| + @results_offset = (params[:iDisplayStart] || 0).to_i | |
| + | |
| + calls_search | |
| + @results = @job.calls.includes(:provider).where(@search_conditions).limi… | |
| + @results_total_display_count = @job.calls.includes(:provider).where(@sea… | |
| + end | |
| + | |
| + respond_to do |format| | |
| + format.html | |
| + format.json { | |
| + render :content_type => 'application/json', :json => render_to_s… | |
| + } | |
| + end | |
| end | |
| - | |
| def view_matches | |
| @result = Call.find(params[:call_id]) | |
| @job_id = @result.job_id | |
| @@ -104,4 +107,47 @@ class AnalyzeController < ApplicationController | |
| end | |
| + | |
| + # Generate a SQL sort by option based on the incoming DataTables paramater. | |
| + # | |
| + # Returns the SQL String. | |
| + def calls_sort_option | |
| + column = case params[:iSortCol_0].to_s | |
| + when '1' | |
| + 'number' | |
| + when '2' | |
| + 'line_type' | |
| + when '3' | |
| + 'peak_freq' | |
| + end | |
| + column + ' ' + (params[:sSortDir_0] =~ /^A/i ? 'asc' : 'desc') if column | |
| + end | |
| + | |
| + def calls_search | |
| + @search_conditions = [] | |
| + terms = params[:sSearch].to_s | |
| + terms = Shellword.shellwords(terms) rescue terms.split(/\s+/) | |
| + where = "job_id = ? AND analysis_completed_at IS NOT NULL " | |
| + param = [ @job_id ] | |
| + glue = "AND " | |
| + terms.each do |w| | |
| + where << glue | |
| + case w | |
| + when /^F(\d+)$/i # F2100 = peak frequency between 20… | |
| + freq = $1.to_i | |
| + where << "( peak_freq > ? AND peak_freq < ? ) " | |
| + param << freq - 5.0 | |
| + param << freq + 5.0 | |
| + else | |
| + where << "( number ILIKE ? OR caller_id ILIKE … | |
| + param << "%#{w}%" | |
| + param << "%#{w}%" | |
| + param << "%#{w}%" | |
| + end | |
| + glue = "AND " if glue.empty? | |
| + @search_conditions = [ where, *param ] | |
| + end | |
| + end | |
| + | |
| + | |
| end | |
| diff --git a/app/controllers/jobs_controller.rb b/app/controllers/jobs_controll… | |
| @@ -72,7 +72,10 @@ class JobsController < ApplicationController | |
| respond_to do |format| | |
| format.html | |
| - format.json { render :partial => 'view_results', :results => @results, :… | |
| + | |
| + format.json { | |
| + render :content_type => 'application/json', :json => render_to_s… | |
| + } | |
| end | |
| end | |
| diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper… | |
| @@ -56,33 +56,6 @@ module ApplicationHelper | |
| end | |
| end | |
| - def format_call_type_details(call) | |
| - ttip = raw("<div class='task_args_formatted'>") | |
| - | |
| - | |
| - ttip << raw("<div class='task_args_var'>Call Time:</di… | |
| - ttip << raw("<div class='task_args_val'>") + h(call.cr… | |
| - | |
| - ttip << raw("<div class='task_args_var'>CallerID:</div… | |
| - ttip << raw("<div class='task_args_val'>") + h(call.ca… | |
| - | |
| - ttip << raw("<div class='task_args_var'>Provider:</div… | |
| - ttip << raw("<div class='task_args_val'>") + h(call.pr… | |
| - | |
| - | |
| - ttip << raw("<div class='task_args_var'>Audio:</div> ") | |
| - ttip << raw("<div class='task_args_val'>") + h(call.au… | |
| - | |
| - | |
| - ttip << raw("<div class='task_args_var'>Ring:</div> ") | |
| - ttip << raw("<div class='task_args_val'>") + h(call.ri… | |
| - | |
| - ttip << raw("</div>\n") | |
| - outp = raw("<span class='xpopover' rel='popover' data-… | |
| - outp | |
| - end | |
| - | |
| - | |
| def format_job_status(job) | |
| case job.status | |
| when 'error' | |
| @@ -137,6 +110,9 @@ module ApplicationHelper | |
| end | |
| + def escape_javascript_dq(str) | |
| + escape_javascript(str.strip).gsub("\\'", "'").gsub("\t", " … | |
| + end | |
| # | |
| # Generate pagination links | |
| diff --git a/app/views/analyze/view.html.erb b/app/views/analyze/view.html.erb | |
| @@ -1,6 +1,8 @@ | |
| +<% include_view_javascript %> | |
| + | |
| <h1 class='title'>Analysis of Scan #<%= @job_id %></h1> | |
| -<table width='100%' align='center' border=0 cellspacing=0 cellpadding=6> | |
| +<table class='table table-striped table-condensed'> | |
| <tr> | |
| <td align='center'> | |
| <%= render :partial => 'shared/graphs/lines_by_type' %> | |
| @@ -8,42 +10,42 @@ | |
| </tr> | |
| </table> | |
| -<%= will_paginate @results, :renderer => BootstrapPagination::Rails %> | |
| -<div class='pull-right'> | |
| - <%= select_tag_for_filter(@filters, params) %> | |
| +<%= form_tag do %> | |
| + | |
| +<div class="control-bar"> | |
| +<table width='100%' border=0 cellpadding=6> | |
| +<tbody><tr> | |
| +<td> | |
| + <%= submit_checkboxes_to(raw('<i class="icon-refresh"></i> Scan'), new… | |
| +</td> | |
| +<td> | |
| + <%= submit_checkboxes_to(raw('<i class="icon-trash"></i> Delete'), pur… | |
| +</td> | |
| +</tr></tbody></table> | |
| + | |
| </div> | |
| -<table class='table table-striped table-condensed'> | |
| + | |
| +<div class="analysis-control-bar"> </div> | |
| + | |
| +<span id="results-path" class="invisible"><%= view_analyze_path(@project, @job… | |
| + | |
| +<table id='results-table' class='table table-striped table-condensed sortable … | |
| <thead> | |
| <tr> | |
| + <th><%= check_box_tag "all_results", false %></th> | |
| <th>Number</th> | |
| <th>Type</th> | |
| - <th>Signal</th> | |
| - <th>Actions</th> | |
| + <th>Signal</th> | |
| </tr> | |
| </thead> | |
| - <tbody> | |
| -<% @results.each do |call| %> | |
| - <tr> | |
| - <td align='center'> | |
| - <%= render :partial => 'shared/call_info', :locals => { :call … | |
| - </td> | |
| - <td align='center'> | |
| - <%= format_call_type_details(call) %> | |
| - </td> | |
| - <td align='center'> | |
| - <span class='pull-left'><%= render :partial => 'shared/lightbo… | |
| - <%= render :partial => 'shared/lightbox_freq', :locals => { :c… | |
| - </td> | |
| - <td> | |
| - <% if call.fprint and call.fprint.length > 0 %> | |
| - <a class="btn" href="<%= view_matches_path(call.projec… | |
| - <% end %> | |
| - </td> | |
| - </tr> | |
| -<% end %> | |
| -</tbody> | |
| + <tbody id="results-list"> | |
| + </tbody> | |
| </table> | |
| -<%= will_paginate @results, :renderer => BootstrapPagination::Rails %> | |
| +<% end %> | |
| + | |
| +<% if false %> | |
| + <a class="btn" href="<%= view_matches_path(call.project_id, call.job_i… | |
| +<% end %> | |
| diff --git a/app/views/jobs/index.html.erb b/app/views/jobs/index.html.erb | |
| @@ -59,7 +59,7 @@ | |
| <% if job.task == "dialer" %> | |
| <a class="btn" href="<%= view_results_path(job.project,job… | |
| <% end %> | |
| - <% if job.task == "analysis" %> | |
| + <% if job.task == "analysis" and job.details[:scope].to_s != "call… | |
| <a class="btn" href="<%= view_analyze_path(job.project,job… | |
| <% end %> | |
| <a class="btn" href="<%= stop_job_path(job) %>" data-confirm="… | |
| diff --git a/app/views/jobs/results.html.erb b/app/views/jobs/results.html.erb | |
| @@ -45,8 +45,8 @@ | |
| <% end %> | |
| </td> | |
| - <td><span rel="tooltip" class="xtooltip" title="<%= pct_answered %>% answe… | |
| - <td><span rel="tooltip" class="xtooltip" title="<%= pct_analyzed %>% analy… | |
| + <td><span rel="tooltip" class="xtooltip" title="<%= pct_answered %>% answe… | |
| + <td><span rel="tooltip" class="xtooltip" title="<%= pct_analyzed %>% analy… | |
| <td><%= job.created_at.strftime("%Y-%m-%d %H:%M:%S") %></td> | |
| diff --git a/app/views/jobs/view_results.html.erb b/app/views/jobs/view_results… | |
| @@ -2,7 +2,6 @@ | |
| <h1 class='title'>Call Results for Scan #<%[email protected]%></h1> | |
| - | |
| <table class='table table-striped table-condensed'> | |
| <tr> | |
| <td align='center'> | |
| @@ -12,20 +11,16 @@ | |
| </table> | |
| - | |
| - | |
| <%= form_tag do %> | |
| <div class="control-bar"> | |
| <table width='100%' border=0 cellpadding=6> | |
| <tbody><tr> | |
| <td> | |
| - <%= submit_checkboxes_to(raw('<i class="icon-refresh"></i> Scan'), new… | |
| + <%= submit_checkboxes_to(raw('<i class="icon-refresh"></i> Scan'), new… | |
| </td><td> | |
| - <%= submit_checkboxes_to(raw('<i class="icon-cog"></i> Analyze'), anal… | |
| + <%= submit_checkboxes_to(raw('<i class="icon-cog"></i> Analyze'), anal… | |
| </td><td> | |
| - <%= submit_checkboxes_to(raw('<i class="icon-trash"></i> Delete'), pur… | |
| -</td><td> | |
| - <a class="btn btn-mini any" href="#"><i class="icon-trash"></i> Purge<… | |
| + <%= submit_checkboxes_to(raw('<i class="icon-trash"></i> Delete'), pur… | |
| </td> | |
| </tr></tbody></table> | |
| @@ -53,6 +48,4 @@ | |
| </tbody> | |
| </table> | |
| -</div> | |
| - | |
| <% end %> | |
| diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/applica… | |
| @@ -35,16 +35,6 @@ | |
| delay: { show: 300, hide: 300 }, | |
| animation: false, | |
| }); | |
| - | |
| - var ap = $("#audio_player"); | |
| - if (ap && null != ap) { | |
| - $("#ubaPlayer").ubaPlayer({ | |
| - codecs: [{name:"MP3", codec: 'audio/mp… | |
| - flashAudioPlayerPath: "/assets/player.… | |
| - swfobjectPath: "/assets/swfobject.js", | |
| - playerContainer: "audio_player" | |
| - }); | |
| - } | |
| }); | |
| <% end %> | |
| </head> | |
| @@ -105,8 +95,6 @@ | |
| <p>WarVOX v<%=WarVOX::VERSION %> © Rapid7, Inc. 2009-20… | |
| </footer> | |
| - <div id="audio_player"></div> | |
| - | |
| </div> | |
| </div> | |
| </div> <!-- /container --> | |
| diff --git a/app/views/shared/_audio_player.html.erb b/app/views/shared/_audio_… | |
| @@ -1 +0,0 @@ | |
| -<ul class="controls audio-player"><li><a class="audioButton" href="<%=resource… | |
| diff --git a/app/views/shared/_call_info.html.erb b/app/views/shared/_call_info… | |
| @@ -1 +1,6 @@ | |
| -<%= render :partial => 'shared/audio_player', :locals => { :call => call } %> | |
| +<h2> | |
| +<object type="application/x-shockwave-flash" data="/assets/musicplayer.swf?son… | |
| + <param name="movie" value="/assets/musicplayer.swf?song_url=<%=resourc… | |
| +</object> | |
| +<%= call.number %> | |
| +</h2> | |
| diff --git a/lib/warvox/jobs/analysis.rb b/lib/warvox/jobs/analysis.rb | |
| @@ -65,7 +65,7 @@ class Analysis < Base | |
| end | |
| case @conf[:scope] | |
| - when 'calls': | |
| + when 'calls' | |
| if @conf[:force] | |
| query = {:id => @conf[:target_ids], :answered … | |
| else | |
| @@ -91,7 +91,7 @@ class Analysis < Base | |
| end | |
| else | |
| # Bail if we don't have a valid scope | |
| - return | |
| + return | |
| end | |
| # Build a list of call IDs, as find_each() gets confused if th… |