From 090d42730c591ab9a40769d103e3864da2461d01 2013-01-22 00:48:22
From: Brian E. Granger <ellisonbg@gmail.com>
Date: 2013-01-22 00:48:22
Subject: [PATCH] Removing IPython.notebook references from tooltip.js

---

diff --git a/IPython/frontend/html/notebook/static/js/tooltip.js b/IPython/frontend/html/notebook/static/js/tooltip.js
index 2060628..61da934 100644
--- a/IPython/frontend/html/notebook/static/js/tooltip.js
+++ b/IPython/frontend/html/notebook/static/js/tooltip.js
@@ -126,7 +126,7 @@ var IPython = (function (IPython) {
         // reexecute last call in pager by appending ? to show back in pager
         var that = this;
         var empty = function () {};
-        IPython.notebook.kernel.execute(
+        cell.kernel.execute(
         that.name + '?', {
             'execute_reply': empty,
             'output': empty,
@@ -212,7 +212,7 @@ var IPython = (function (IPython) {
         var callbacks = {
             'object_info_reply': $.proxy(this._show, this)
         }
-        var msg_id = IPython.notebook.kernel.object_info_request(re.exec(func), callbacks);
+        var msg_id = cell.kernel.object_info_request(re.exec(func), callbacks);
     }
 
     // make an imediate completion request
@@ -360,11 +360,12 @@ var IPython = (function (IPython) {
     // convenient funciton to have the correct code_mirror back into focus
     Tooltip.prototype._cmfocus = function () {
         var cm = this.code_mirror;
-        if (cm == IPython.notebook.get_selected_cell())
-        {
-            setTimeout(function () {
-                cm.focus();
-            }, 50);
+        if (IPython.notebook !== undefined) {
+            if (cm == IPython.notebook.get_selected_cell()) {
+                setTimeout(function () {
+                    cm.focus();
+                }, 50);
+            }
         }
     }