diff --git a/IPython/html/static/notebook/js/celltoolbar.js b/IPython/html/static/notebook/js/celltoolbar.js index e320212..fc69d38 100644 --- a/IPython/html/static/notebook/js/celltoolbar.js +++ b/IPython/html/static/notebook/js/celltoolbar.js @@ -234,7 +234,7 @@ var IPython = (function (IPython) { * */ CellToolbar.rebuild_all = function(){ - for(var i in CellToolbar._instances){ + for(var i=0; i < CellToolbar._instances.length; i++){ CellToolbar._instances[i].rebuild(); } }; @@ -252,8 +252,8 @@ var IPython = (function (IPython) { var callbacks = CellToolbar._callback_dict; var preset = CellToolbar._ui_controls_list; // Yes we iterate on the class variable, not the instance one. - for (var index in preset) { - var key = preset[index]; + for (var i=0; i < preset.length; i++) { + var key = preset[i]; var callback = callbacks[key]; if (!callback) continue; @@ -380,10 +380,10 @@ var IPython = (function (IPython) { var button_container = $(div); var lbl = $("").append($('').text(label)); var select = $('').addClass('ui-widget ui-widget-content'); - for(var itemn in list_list){ + for(var i=0; i < list_list.length; i++){ var opt = $('') - .attr('value', list_list[itemn][1]) - .text(list_list[itemn][0]); + .attr('value', list_list[i][1]) + .text(list_list[i][0]); select.append(opt); } select.val(getter(cell)); diff --git a/IPython/html/static/notebook/js/completer.js b/IPython/html/static/notebook/js/completer.js index 14e13b6..df940b3 100644 --- a/IPython/html/static/notebook/js/completer.js +++ b/IPython/html/static/notebook/js/completer.js @@ -13,15 +13,16 @@ var IPython = (function (IPython) { str = '%'+str ; } return str; - } + }; function _existing_completion(item, completion_array){ - for( var c in completion_array ) { - if(completion_array[c].trim().substr(-item.length) == item) - { return true; } + for( var i=0; i < completion_array.length; i++) { + if (completion_array[i].trim().substr(-item.length) == item) { + return true; + } } - return false; - } + return false; + }; // what is the common start of all completions function shared_start(B, drop_prct) { @@ -164,9 +165,9 @@ var IPython = (function (IPython) { var filtered_results = []; //remove results from context completion //that are already in kernel completion - for (var elm in results) { - if (!_existing_completion(results[elm].str, matches)) { - filtered_results.push(results[elm]); + for (var i=0; i < results.length; i++) { + if (!_existing_completion(results[i].str, matches)) { + filtered_results.push(results[i]); } } diff --git a/IPython/html/static/notebook/js/outputarea.js b/IPython/html/static/notebook/js/outputarea.js index e8e193d..7bdcb52 100644 --- a/IPython/html/static/notebook/js/outputarea.js +++ b/IPython/html/static/notebook/js/outputarea.js @@ -503,8 +503,8 @@ var IPython = (function (IPython) { }; OutputArea.prototype.append_mime_type = function (json, element, handle_inserted) { - for (var type_i in OutputArea.display_order) { - var type = OutputArea.display_order[type_i]; + for (var i=0; i < OutputArea.display_order.length; i++) { + var type = OutputArea.display_order[i]; var append = OutputArea.append_map[type]; if ((json[type] !== undefined) && append) { var value = json[type]; diff --git a/IPython/html/static/notebook/js/toolbar.js b/IPython/html/static/notebook/js/toolbar.js index f28e2a4..6f0052a 100644 --- a/IPython/html/static/notebook/js/toolbar.js +++ b/IPython/html/static/notebook/js/toolbar.js @@ -65,20 +65,22 @@ var IPython = (function (IPython) { */ ToolBar.prototype.add_buttons_group = function (list, group_id) { var btn_group = $('
').addClass("btn-group"); - if( group_id != undefined ) { + if( group_id !== undefined ) { btn_group.attr('id',group_id); } - for(var el in list) { + var el; + for(var i=0; i < list.length; i++) { + el = list[i]; var button = $('') .addClass('btn') - .attr("title", list[el].label) + .attr("title", el.label) .append( - $("").addClass(list[el].icon) + $("").addClass(el.icon) ); - var id = list[el].id; - if( id != undefined ) + var id = el.id; + if( id !== undefined ) button.attr('id',id); - var fun = list[el].callback; + var fun = el.callback; button.click(fun); btn_group.append(button); } @@ -96,7 +98,7 @@ var IPython = (function (IPython) { */ ToolBar.prototype.toggle = function () { this.element.toggle(); - if (IPython.layout_manager != undefined) { + if (IPython.layout_manager !== undefined) { IPython.layout_manager.do_resize(); } };