This commit is contained in:
Kovid Goyal 2011-12-14 19:08:01 +05:30
parent 23bc88c681
commit 9a2f9517f7
3 changed files with 11 additions and 4 deletions

View File

@ -7,11 +7,10 @@
### ###
viewport_top = (node) -> viewport_top = (node) ->
node.offsetTop - window.pageYOffset $(node).offset().top - window.pageYOffset
viewport_left = (node) -> viewport_left = (node) ->
node.offsetLeft - window.pageXOffset $(node).offset().left - window.pageXOffset
window.onload = -> window.onload = ->
h1 = document.getElementsByTagName('h1')[0] h1 = document.getElementsByTagName('h1')[0]

View File

@ -3,6 +3,7 @@
<head> <head>
<title>Testing CFI functionality</title> <title>Testing CFI functionality</title>
<script type="text/javascript" src="cfi.js"></script> <script type="text/javascript" src="cfi.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="cfi-test.js"></script> <script type="text/javascript" src="cfi-test.js"></script>
</head> </head>
<body> <body>

View File

@ -12,13 +12,20 @@ Utilities to help with developing coffeescript based apps
''' '''
import time, SimpleHTTPServer, SocketServer, threading, os, subprocess 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): class Server(threading.Thread):
def __init__(self, port=8000): def __init__(self, port=8000):
threading.Thread.__init__(self) threading.Thread.__init__(self)
self.port = port self.port = port
self.daemon = True self.daemon = True
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
self.httpd = SocketServer.TCPServer(("localhost", port), Handler) self.httpd = SocketServer.TCPServer(("localhost", port), Handler)
def run(self): def run(self):