forked from serras/reactive-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added JS library - Added compile script
- Loading branch information
Alejandro
committed
Dec 13, 2010
1 parent
14e9771
commit 9d3c5d1
Showing
3 changed files
with
229 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
arrowp < ${1} > ${1/.hs/.no-arrows.hs} | ||
uhc -t jscript ${1/.hs/.no-arrows.hs} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
function getCurrentTime() { | ||
var d = new Date(); | ||
return d.getTime(); | ||
} | ||
|
||
function mousePosition() { | ||
var posx = 0; | ||
var posy = 0; | ||
if (!e) var e = window.event; | ||
if (e.pageX || e.pageY) { | ||
posx = e.pageX; | ||
posy = e.pageY; | ||
} | ||
else if (e.clientX || e.clientY) { | ||
posx = e.clientX + document.body.scrollLeft | ||
+ document.documentElement.scrollLeft; | ||
posy = e.clientY + document.body.scrollTop | ||
+ document.documentElement.scrollTop; | ||
} | ||
// posx and posy contain the mouse position relative to the document | ||
// Do something with this information | ||
|
||
return [posx, posy]; | ||
} | ||
|
||
function mouseX() { | ||
var position = mousePosition(); | ||
return position[0]; | ||
} | ||
|
||
function mouseY() { | ||
var position = mousePosition(); | ||
return position[1]; | ||
} | ||
|
||
function changeText(div, text) { | ||
document.getElementById(div).innerHTML = text; | ||
} | ||
|
||
function addEvent(div, event, guiref, rhandle, response) { | ||
if (event == "timeout") { | ||
var closure = function() { | ||
respond(guiref, rhandle, response); | ||
} | ||
setTimeout(closure, 30); | ||
} | ||
} |