diff --git a/bower.json b/bower.json index 00fcb6ecc..dbebe4be0 100644 --- a/bower.json +++ b/bower.json @@ -17,6 +17,7 @@ "requirejs": "~2.1", "term.js": "chjj/term.js#~0.0.4", "text-encoding": "~0.1", - "underscore": "components/underscore#~1.5" + "underscore": "components/underscore#~1.5", + "jquery-typeahead": "~2.0.0" } } diff --git a/notebook/static/notebook/js/actions.js b/notebook/static/notebook/js/actions.js index 664f50b5e..240a3c79b 100644 --- a/notebook/static/notebook/js/actions.js +++ b/notebook/static/notebook/js/actions.js @@ -3,6 +3,8 @@ define(function(require){ "use strict"; + + var dialog = require("base/js/dialog"); var ActionHandler = function (env) { this.env = env || {}; @@ -329,10 +331,26 @@ define(function(require){ handler : function (env) { env.pager.collapse(); } + }, + 'quick-menu': { + help_index : 'aa', + handler : function(env){ + var searchfield = $('input').attr('type', 'text'); + + dialog.modal({ + title: 'Execute Action', + body: $('
') + .append(searchfield) + buttons: { + OK: {'class': 'btn-primary'} + } + }); + } } }; + /** * A bunch of `Advance actions` for Jupyter. * Cf `Simple Action` plus the following properties. diff --git a/notebook/static/notebook/js/main.js b/notebook/static/notebook/js/main.js index 71f3567f7..52a51aed8 100644 --- a/notebook/static/notebook/js/main.js +++ b/notebook/static/notebook/js/main.js @@ -22,6 +22,7 @@ require([ 'notebook/js/kernelselector', 'codemirror/lib/codemirror', 'notebook/js/about', + 'typeahead', // only loaded, not used, please keep sure this is loaded last 'custom/custom' ], function( @@ -45,6 +46,7 @@ require([ kernelselector, CodeMirror, about, + typeahead, // please keep sure that even if not used, this is loaded last custom ) { diff --git a/notebook/templates/page.html b/notebook/templates/page.html index 415d9922a..026342d12 100644 --- a/notebook/templates/page.html +++ b/notebook/templates/page.html @@ -37,8 +37,13 @@ moment: 'components/moment/moment', codemirror: 'components/codemirror', termjs: 'components/term.js/src/term', + typeahead: 'components/jquery-typeahead/dist/jquery.typeahead' }, shim: { + typeahead: { + deps: ["jquery"], + exports: "typeahead" + }, underscore: { exports: '_' }, diff --git a/tools/build-main.js b/tools/build-main.js index 09ee6853f..00763b9b8 100644 --- a/tools/build-main.js +++ b/tools/build-main.js @@ -22,9 +22,14 @@ var rjs_config = { moment: 'components/moment/moment', codemirror: 'components/codemirror', termjs: 'components/term.js/src/term', + typeahead: 'components/jquery-typeahead/dist/jquery.typeahead', contents: 'empty:' }, shim: { + typeahead: { + deps: ["jquery"], + exports: "typeahead" + }, underscore: { exports: '_' },