From 0fc9232f14717aace52a41e7ba7c86975debac6b Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 14 Aug 2015 18:51:42 -0700 Subject: [PATCH] Move search and replace to it's own file load as if it was an extension. --- notebook/static/notebook/js/actions.js | 292 ----------------- notebook/static/notebook/js/main.js | 3 + notebook/static/notebook/js/notebook.js | 1 - .../static/notebook/js/searchandreplace.js | 306 ++++++++++++++++++ 4 files changed, 309 insertions(+), 293 deletions(-) create mode 100644 notebook/static/notebook/js/searchandreplace.js diff --git a/notebook/static/notebook/js/actions.js b/notebook/static/notebook/js/actions.js index 6c82253cd..9478ec2b2 100644 --- a/notebook/static/notebook/js/actions.js +++ b/notebook/static/notebook/js/actions.js @@ -4,17 +4,12 @@ define(function(require){ "use strict"; - var dialog = require('base/js/dialog'); var ActionHandler = function (env) { this.env = env || {}; Object.seal(this); }; - function escapeRegExp(string){ - return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - } - /** * Give a `needle` string, find all occurences of `needle` ins it * and return an array of [][start, stop], ...] non-overlapping indexes. @@ -373,295 +368,8 @@ define(function(require){ env.notebook.show_command_palette(); } }, - 'search-and-replace-dialog': { - help: 'search and replace', - handler: function(env){ - var search = $("") - .addClass('form-control') - .css('width','86%') - .attr('placeholder','Search'); - var isRegExpButton = $('