UnionDrawのペンの色を変えるブックマークレット
by
coppieee
2011-06-02 [2011/06/02 17:47:37]
http://unionplatform.com/samples/orbitermicro/UnionDraw/uniondraw.html で実行してみて。
@@ -1,5 +1,5 @@
/*
- * @title bookmarklet
+ * @title UnionDrawのペンの色を変える
* @description my bookmarklet
* @include http://unionplatform.com/samples/orbitermicro/UnionDraw/uniondraw.html
* @license MIT License
/*
* @title UnionDrawのペンの色を変える
* @description my bookmarklet
* @include http://unionplatform.com/samples/orbitermicro/UnionDraw/uniondraw.html
* @license MIT License
* @require
*/
(function(){
var _colorChange = function (rgb) {
// Determine which option was selected
var newColor = rgb;
// Locally, set the line color to the selected value
localLineColor = newColor;
// Share selected color with other users
msgManager.sendUPC(UPC.SET_CLIENT_ATTR,
orbiter.getClientID(),
"",
Attributes.COLOR,
newColor,
roomID,
"4");
// Scroll the iPhone back to the top-left.
iPhoneToTop();
};
(function() {
var xs = ['00','11','22','33','44','55','66','77','88','99','aa','bb','cc','dd','ee','ff'];
var r = xs[Math.random() * xs.length | 0];
var g = xs[Math.random() * xs.length | 0];
var b = xs[Math.random() * xs.length | 0];
var rgb = '#' + r + g + b;
document.getElementById('color')[1].innerText = rgb;
_colorChange(rgb);
setTimeout(arguments.callee, 100) ;
})();
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。