(goggles)
=========
***See it in action at [http://goggles.sneakygcr.net][sneakygcr]!***
A little system in the tradition of [hoodwinkd][hoodwinkd], goggles lets you peer
behind the webpages you visit and draw things that other goggles users can see.
It's like an alternate dimension full of graffiti.
Goggles' graffiti is completely invisible to those who do not have their goggles
on.
Technical details
-----------------
There are four parts:
1. Landing page
2. Bookmarklet
3. Bookmarklet stage 2
4. Goggles server
The user goes to the [landing page][sneakygcr] where they will see the
bookmarklet button. The user then drags that bookmarklet to their bookmarks bar.
The bookmarklet code is straight inside the page's HTML and is automatically
"compressed" and "minified" by javascript on the landing page. (See the
[source code][landing source]).
The bookmarklet is pretty simple; it just chainloads the bigger 'stage 2' code
that is appended to the page. The server generates and serves the
[stage 2 code][stage 2 source] by concatenating all the files in the
bookmarklet.d folder together and then sending it through google's closure
compiler API.
The stage 2 code handles all of the drawing, presentation, and protocol. It
adds jquery to the web page (and tries to not conflict), adds a huge transparent
`<canvas/>` element and then streams shape updates from the server.
The server keeps track of the shapes, streams new shape events to clients with
jsonp, and manages pages.
Deploy details
--------------
The server is written in nodejs. No extra dependencies are needed beyond
node 0.3.1 or better. Note that it's quite stupid; there are memory leaks and
the "database" is just filesystem-based storage using a repository format very
similar to git (see [keystore][keystore.js]). You will have to restart the
server from time to time if it gets popular.
Best served hiding behind nginx with transparent gzip turned on. Suggested nginx
configuration:
server {
listen 80;
server_name goggles.sneakygcr.net;
location = /favicon.ico { empty_gif; }
location / {
proxy_pass http://127.0.0.1:8002;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffering off;
gzip on;
gzip_comp_level 9;
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/plain text/javascript text/html;
gzip_disable "MSIE [1-6]\.";
}
}
[hoodwinkd]: http://web.archive.org/web/20080106065546/http://hoodwinkd.hobix.com/
[sneakygcr]: http://goggles.sneakygcr.net
[landing source]: https://github.com/gcr/goggles/blob/master/resources/index.htm
[stage 2 source]: https://github.com/gcr/goggles/tree/master/bookmarklet.d
[keystore.js]: https://github.com/gcr/goggles/blob/master/models/keystore.js
没有合适的资源?快使用搜索试试~ 我知道了~
涂鸦用镜子_JavaScript_HTML_下载.zip
共50个文件
js:34个
png:7个
gif:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 183 浏览量
2023-05-01
20:50:31
上传
评论
收藏 288KB ZIP 举报
温馨提示
涂鸦用镜子_JavaScript_HTML_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
涂鸦用镜子_JavaScript_HTML_下载.zip (50个子文件)
goggles-master
runtests.sh 288B
store
data-lives-in-here 0B
resources
cross.gif 83B
index.htm 7KB
brushed-metal.png 9KB
color-picker.png 797B
hs.png 3KB
button-overlay.png 13KB
color-swoosh.png 139KB
dark-bg.png 68KB
arrow.gif 66B
hv.png 3KB
server.js 617B
bookmarklet.d
20-picker.js 5KB
60-canvas-rendering.js 1KB
50-mouse-drawing.js 3KB
15-url-picker.js 784B
10-utility.js 430B
15-jscolor.js 22KB
95-bootstrap.js 74B
99-foot.js 423B
40-goggles.js 4KB
00-head.js 256B
75-ajax.js 5KB
30-shapes.js 10KB
.gitmodules 189B
test
lib
vows
eyes
history-test.js 4KB
common.js 2KB
cachestore-test.js 2KB
keystore-test.js 1KB
basic-sanity-test.js 418B
asynclock-test.js 968B
protocol-test.js 6KB
models
sha1.js 9KB
fading.js 893B
async_lock.js 1015B
cachestore.js 797B
history.js 2KB
pagestore.js 2KB
shape.js 3KB
page.js 7KB
keystore.js 2KB
.gitignore 12B
site.js 4KB
README.md 3KB
views
bookmarklet_renderer.js 3KB
switchboard.js 5KB
static.js 6KB
view_helpers.js 999B
COPYING 2KB
共 50 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功