From 287dddc06fe94fcd5c249ca29189bbb7941bc321 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sat, 29 Jan 2011 21:13:25 -0500 Subject: [PATCH] Fixing jslint problems --- static/scripts/galaxy.panels.js | 24 +++++++++---------- .../scripts/galaxy.workflow_editor.canvas.js | 13 +++++----- static/scripts/trackster.js | 14 +++++------ 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/static/scripts/galaxy.panels.js b/static/scripts/galaxy.panels.js index f7eba144b8b..106021ac49d 100644 --- a/static/scripts/galaxy.panels.js +++ b/static/scripts/galaxy.panels.js @@ -19,7 +19,7 @@ function make_left_panel( panel_el, center_el, border_el ) { $( border_el ).css( "left", oldx ); $( center_el ).css( "left", x+7 ); // ie7-recalc.js - if ( document.recalc ) { document.recalc() }; + if ( document.recalc ) { document.recalc(); } }; var toggle = function() { if ( hidden ) { @@ -34,7 +34,7 @@ function make_left_panel( panel_el, center_el, border_el ) { saved_size = $( border_el ).position().left; // Move center $( center_el ).css( "left", $(border_el).innerWidth() ); - if ( document.recalc ) { document.recalc() }; + if ( document.recalc ) { document.recalc(); } $( border_el).removeClass( "hover" ); $( panel_el ).animate( { left: - saved_size }, "fast" ); $( border_el ).animate( { left: -1 }, "fast", function() { @@ -80,9 +80,9 @@ function make_right_panel( panel_el, center_el, border_el ) { var resize = function( x ) { $( panel_el ).css( "width", x ); $( center_el ).css( "right", x+9 ); - $( border_el ).css( "right", x ).css( "left", "" ) + $( border_el ).css( "right", x ).css( "left", "" ); // ie7-recalc.js - if ( document.recalc ) { document.recalc() }; + if ( document.recalc ) { document.recalc(); } }; var toggle = function() { if ( hidden ) { @@ -90,7 +90,7 @@ function make_right_panel( panel_el, center_el, border_el ) { $( border_el ).animate( { right: saved_size }, "fast" ); $( panel_el ).css( "right", - saved_size ).show().animate( { "right": 0 }, "fast", function () { resize( saved_size ); - $( border_el ).removeClass( "hidden" ) + $( border_el ).removeClass( "hidden" ); }); hidden = false; } @@ -99,12 +99,12 @@ function make_right_panel( panel_el, center_el, border_el ) { saved_size = $(document).width() - $( border_el ).position().left - $(border_el).outerWidth(); // Move center $( center_el ).css( "right", $(border_el).innerWidth() + 1 ); - if ( document.recalc ) { document.recalc() }; + if ( document.recalc ) { document.recalc(); } // Hide border $( border_el ).removeClass( "hover" ); $( panel_el ).animate( { right: - saved_size }, "fast" ); $( border_el ).animate( { right: -1 }, "fast", function() { - $( this ).addClass( "hidden" ) + $( this ).addClass( "hidden" ); }); hidden = true; } @@ -116,7 +116,7 @@ function make_right_panel( panel_el, center_el, border_el ) { { if ( ! hidden ) { toggle(); - hidden_by_tool = true + hidden_by_tool = true; } } else { if ( hidden_by_tool ) { @@ -126,8 +126,8 @@ function make_right_panel( panel_el, center_el, border_el ) { } }; $( border_el ).hover( - function() { $( this ).addClass( "hover" ) }, - function() { $( this ).removeClass( "hover" ) } + function() { $( this ).addClass( "hover" ); }, + function() { $( this ).removeClass( "hover" ); } ).bind( "dragstart", function() { $( '#DD-helper' ).show(); }).bind( "dragend", function() { @@ -201,7 +201,7 @@ function show_modal( title, body, buttons, extra_buttons, init_fn ) { $( ".dialog-box" ).find( ".body" ).html( body ); if ( ! $(".dialog-box-container").is( ":visible" ) ) { $("#overlay").show(); - $(".dialog-box-container").fadeIn() + $(".dialog-box-container").fadeIn(); } // Fix min-width so that modal cannot shrink considerably if // new content is loaded. @@ -220,7 +220,7 @@ function show_in_overlay( options ) { $("#overlay-background").unbind( "click.overlay" ); }); show_modal( null, $( "
" ) ); - $("#close_button").bind( "click", function() { hide_modal() } ); + $("#close_button").bind( "click", function() { hide_modal(); } ); } // Tab management diff --git a/static/scripts/galaxy.workflow_editor.canvas.js b/static/scripts/galaxy.workflow_editor.canvas.js index 6df314992cd..dcb4600e3bf 100644 --- a/static/scripts/galaxy.workflow_editor.canvas.js +++ b/static/scripts/galaxy.workflow_editor.canvas.js @@ -287,7 +287,7 @@ $.extend( Node.prototype, { this.form_html = data.form_html; this.tool_state = data.tool_state; this.tool_errors = data.tool_errors; - this.tooltip = data.tooltip ? data.tooltip : "" + this.tooltip = data.tooltip ? data.tooltip : ""; this.annotation = data.annotation; this.post_job_actions = data.post_job_actions ? data.post_job_actions : {}; this.workflow_outputs = data.workflow_outputs ? data.workflow_outputs : []; @@ -500,11 +500,12 @@ $.extend( Workflow.prototype, { pjas_to_rem.push(pja_id); } }); - if (pjas_to_rem.length > 0 && node == workflow.active_node) - $.each(pjas_to_rem, function(i, pja_name){ - node_changed = true; - delete node.post_job_actions[pja_name]; - }) + if (pjas_to_rem.length > 0 && node == workflow.active_node) { + $.each(pjas_to_rem, function(i, pja_name){ + node_changed = true; + delete node.post_job_actions[pja_name]; + }); + } $.each(node.output_terminals, function(ot_id, ot){ var create_pja = true; $.each(node.workflow_outputs, function(i, wo_name){ diff --git a/static/scripts/trackster.js b/static/scripts/trackster.js index 5c638c7755a..ad9d8e764b5 100644 --- a/static/scripts/trackster.js +++ b/static/scripts/trackster.js @@ -90,7 +90,7 @@ $.extend(Cache.prototype, { get: function(key) { var index = this.key_ary.indexOf(key); if (index != -1) { - this.move_key_to_end(key, index) + this.move_key_to_end(key, index); } return this.obj_cache[key]; }, @@ -154,7 +154,7 @@ $.extend(DataCache.prototype, Cache.prototype, { // var key, split_key, entry_low, entry_high, mode, entry; for (var i = 0; i < this.key_ary.length; i++) { - key = this.key_ary[i] + key = this.key_ary[i]; split_key = this.split_key(key); entry_low = split_key[0]; entry_high = split_key[1]; @@ -969,7 +969,7 @@ var TiledTrack = function(filters, tool, parent_track) { var tool_params = this.tool.params; var track = this; $.each(this.tool.params, function(index, param) { - var param_div = $("
").addClass("param-row").appendTo(track.dynamic_tool_div) + var param_div = $("
").addClass("param-row").appendTo(track.dynamic_tool_div); // // Slider label. @@ -1166,7 +1166,7 @@ var TiledTrack = function(filters, tool, parent_track) { var no_tracks_fn = function() { $("#no-tracks").show(); }; if (this.parent_track) { // Track is child track. - parent_obj = this.parent_track + parent_obj = this.parent_track; no_tracks_fn = function() {}; } track_dropdown.Remove = function() { @@ -1329,7 +1329,7 @@ $.extend( TiledTrack.prototype, Track.prototype, { chrom: this.view.chrom, low: this.view.low, high: this.view.high, - tool_id: this.tool.name, + tool_id: this.tool.name }; $.extend(url_params, this.tool.get_param_values_dict()); @@ -1388,7 +1388,7 @@ $.extend( TiledTrack.prototype, Track.prototype, { // Region is chrom:low-high or 'all.' var track = this, - region = (chrom !== undefined && low !== undefined && high != undefined ? + region = (chrom !== undefined && low !== undefined && high !== undefined ? chrom + ":" + low + "-" + high : "all"); return " - region=[" + region + "], parameters=[" + track.tool.get_param_values().join(", ") + "]"; }, @@ -1823,7 +1823,7 @@ $.extend( FeatureTrack.prototype, TiledTrack.prototype, { // Returns -1 if no slot was found. var find_slot = function(f_start, f_end) { var found; - for (var slot_num = 0, slot = undefined; slot_num <= MAX_FEATURE_DEPTH; slot_num++) { + for (var slot_num = 0, slot; slot_num <= MAX_FEATURE_DEPTH; slot_num++) { found = true; slot = s_e_by_tile[slot_num]; if (slot !== undefined) {