Skip to content

Commit

Permalink
basic dragging works
Browse files Browse the repository at this point in the history
  • Loading branch information
jtwb2 committed Feb 27, 2010
1 parent 9b31cf5 commit 190c6b7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
Empty file removed draggies.css
Empty file.
Empty file removed draggies.js
Empty file.
16 changes: 0 additions & 16 deletions index.html

This file was deleted.

14 changes: 10 additions & 4 deletions static/draggies.js
@@ -1,5 +1,8 @@
if (typeof console == "undefined") { console = {log: function(m){}} };

$(function(){
var getNewId = function() {
// TODO overwrite with a hashing algorithm?
return 'xxxxxxxx-xxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
return v.toString(16);
Expand All @@ -16,12 +19,15 @@ $(function(){
console.log('loopback; ignore');
//return;
}
if ($('#'+message.el)[0])
$('#'+message.el);
if ($('#'+message.el)[0]) {
$('#'+message.el).css({
left: message.x,
top: message.y
});
} else {
newBox({left: message.x, top: message.y}, message.el);
}
console.log(el);
console.log(message.el);
},
fayesend = function(pos, id) {
var data = {
Expand All @@ -31,7 +37,7 @@ $(function(){
y: pos.top
};
// placeholder
console.log('starting fayesync');
console.log('starting fayesend');
console.log('sending data');
console.log(data);
fayeclient.publish(fayepath, data);
Expand Down

0 comments on commit 190c6b7

Please sign in to comment.