diff --git a/src/calibre/ebooks/oeb/display/test/cfi-test.coffee b/src/calibre/ebooks/oeb/display/test/cfi-test.coffee
index 5519b8625a..056d24b396 100644
--- a/src/calibre/ebooks/oeb/display/test/cfi-test.coffee
+++ b/src/calibre/ebooks/oeb/display/test/cfi-test.coffee
@@ -7,11 +7,10 @@
###
viewport_top = (node) ->
- node.offsetTop - window.pageYOffset
+ $(node).offset().top - window.pageYOffset
viewport_left = (node) ->
- node.offsetLeft - window.pageXOffset
-
+ $(node).offset().left - window.pageXOffset
window.onload = ->
h1 = document.getElementsByTagName('h1')[0]
diff --git a/src/calibre/ebooks/oeb/display/test/test.html b/src/calibre/ebooks/oeb/display/test/test.html
index df93620c2c..71dac39249 100644
--- a/src/calibre/ebooks/oeb/display/test/test.html
+++ b/src/calibre/ebooks/oeb/display/test/test.html
@@ -3,6 +3,7 @@
Testing CFI functionality
+
diff --git a/src/calibre/utils/coffeescript.py b/src/calibre/utils/coffeescript.py
index 4d6d54e7f6..22a71cc0c2 100644
--- a/src/calibre/utils/coffeescript.py
+++ b/src/calibre/utils/coffeescript.py
@@ -12,13 +12,20 @@ Utilities to help with developing coffeescript based apps
'''
import time, SimpleHTTPServer, SocketServer, threading, os, subprocess
+class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
+
+ def translate_path(self, path):
+ if path.endswith('jquery.js'):
+ return P('content_server/jquery.js')
+ return SimpleHTTPServer.SimpleHTTPRequestHandler.translate_path(self,
+ path)
+
class Server(threading.Thread):
def __init__(self, port=8000):
threading.Thread.__init__(self)
self.port = port
self.daemon = True
- Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
self.httpd = SocketServer.TCPServer(("localhost", port), Handler)
def run(self):