diff --git a/src/jupyter_contrib_nbextensions/nbextensions/search/main.js b/src/jupyter_contrib_nbextensions/nbextensions/search/main.js deleted file mode 100644 index 1cf1f6735..000000000 --- a/src/jupyter_contrib_nbextensions/nbextensions/search/main.js +++ /dev/null @@ -1,81 +0,0 @@ -// Simple search extension based on a codemirror addon. -// Adds a search box to the notebook toolbar and selects search word if found. - -require(['/static/components/codemirror/addon/search/search.js']); -require(['/static/components/codemirror/addon/search/searchcursor.js']); - -"using strict"; - -search_toolbar = function() { - - search = function(hotkey) { - if (hotkey != 0 && hotkey != 13) { - return false; - } - - var cell = IPython.notebook.get_selected_cell(); - if (cell.rendered == true && cell.cell_type == "markdown" ) cell.unrender(); - - var findString = IPython.toolbar.element.find('#search').val(); - var cur = cell.code_mirror.getCursor(); - - if(cell.element.find('#RegExp').val() == "ON"){ - findString = new RegExp(findString); - } - var find = cell.code_mirror.getSearchCursor(findString,cur, $('#menubar-container').find('#CaseSensitive').val()=="OFF"); - if (find.find() == true) { - cell.code_mirror.setSelection(find.pos.from,find.pos.to); - cell.code_mirror.focus(); - } else { - var ncells = IPython.notebook.ncells(); - if ( IPython.notebook.get_selected_index()+1 == ncells) { - cell.code_mirror.focus(); - } else { - IPython.notebook.select_next(); - IPython.notebook.edit_mode(); - cell.code_mirror.setCursor({line:0, ch:0}); - return search(hotkey); - } - } - }; - - var celltoolbar = IPython.toolbar.element; - - var search_group = $('
').addClass("btn-group"); - var input = $('') - .addClass("inpt") - .attr("Title","Search for text") - .on('keyup', function(event) { search(event.keyCode);}); - search_group.append(input); - - var button = $('