Permalink
Browse files

Added script to shuffle all letters in firefox

  • Loading branch information...
1 parent b2c2987 commit 39614be38a0c643989f1ee9e7be8d1dde09ad6dc @bnoguchi bnoguchi committed Aug 19, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 debug/shuffleLetters.js
@@ -0,0 +1,16 @@
+// Run this in firefox after you go into offline mode
+
+for (var i = 0, l = 26*5; i < l; i++) {
+ var letter = document.getElementById(i)
+ , drag = document.createEvent('DragEvents');
+ drag.initDragEvent('dragstart', true, true, window, 0, 0, 0, parseInt(letter.style.left, 10), parseInt(letter.style.top, 10), false, false, false, false, 0, null, {setData: function () {} });
+ letter.dispatchEvent(drag);
+
+ var drop = document.createEvent('DragEvents');
+ drop.initDragEvent('drop', true, true, window, 0, 0, 0, Math.random() * 700, Math.random() * 400, false, false, false, false, 0, null, {})
+ letter.dispatchEvent(drop);
+
+ var dragend = document.createEvent('DragEvents');
+ dragend.initEvent('dragend', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ letter.dispatchEvent(dragend);
+}

0 comments on commit 39614be

Please sign in to comment.