From 5e3e19d75ca85a21a6f46fd1d794e4ca56839e0b Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Sat, 7 Jun 2008 18:15:44 +0000 Subject: moved (still experimental) test automation files to experimental branch --- tests/autodrag.html | 156 ----------------- tests/cursors/linux/auto.png | Bin 851 -> 0 bytes tests/cursors/linux/crosshair.png | Bin 413 -> 0 bytes tests/cursors/linux/default.png | Bin 851 -> 0 bytes tests/cursors/linux/e-resize.png | Bin 861 -> 0 bytes tests/cursors/linux/help.png | Bin 1279 -> 0 bytes tests/cursors/linux/move.png | Bin 710 -> 0 bytes tests/cursors/linux/n-resize.png | Bin 871 -> 0 bytes tests/cursors/linux/ne-resize.png | Bin 836 -> 0 bytes tests/cursors/linux/none.cur | Bin 2238 -> 0 bytes tests/cursors/linux/none.png | Bin 872 -> 0 bytes tests/cursors/linux/nw-resize.png | Bin 824 -> 0 bytes tests/cursors/linux/pointer.png | Bin 541 -> 0 bytes tests/cursors/linux/s-resize.png | Bin 871 -> 0 bytes tests/cursors/linux/se-resize.png | Bin 824 -> 0 bytes tests/cursors/linux/sw-resize.png | Bin 836 -> 0 bytes tests/cursors/linux/text.png | Bin 486 -> 0 bytes tests/cursors/linux/w-resize.png | Bin 861 -> 0 bytes tests/cursors/mac/auto.png | Bin 401 -> 0 bytes tests/cursors/mac/crosshair.png | Bin 341 -> 0 bytes tests/cursors/mac/default.png | Bin 401 -> 0 bytes tests/cursors/mac/e-resize.png | Bin 390 -> 0 bytes tests/cursors/mac/help.png | Bin 689 -> 0 bytes tests/cursors/mac/move.png | Bin 651 -> 0 bytes tests/cursors/mac/n-resize.png | Bin 434 -> 0 bytes tests/cursors/mac/ne-resize.png | Bin 440 -> 0 bytes tests/cursors/mac/none.cur | Bin 2238 -> 0 bytes tests/cursors/mac/none.png | Bin 872 -> 0 bytes tests/cursors/mac/nw-resize.png | Bin 452 -> 0 bytes tests/cursors/mac/pointer.png | Bin 675 -> 0 bytes tests/cursors/mac/s-resize.png | Bin 434 -> 0 bytes tests/cursors/mac/se-resize.png | Bin 452 -> 0 bytes tests/cursors/mac/sw-resize.png | Bin 440 -> 0 bytes tests/cursors/mac/text.png | Bin 436 -> 0 bytes tests/cursors/mac/w-resize.png | Bin 390 -> 0 bytes tests/cursors/win/auto.png | Bin 724 -> 0 bytes tests/cursors/win/crosshair.png | Bin 304 -> 0 bytes tests/cursors/win/default.png | Bin 724 -> 0 bytes tests/cursors/win/e-resize.png | Bin 714 -> 0 bytes tests/cursors/win/help.png | Bin 1129 -> 0 bytes tests/cursors/win/move.png | Bin 1035 -> 0 bytes tests/cursors/win/n-resize.png | Bin 722 -> 0 bytes tests/cursors/win/ne-resize.png | Bin 985 -> 0 bytes tests/cursors/win/none.cur | Bin 2238 -> 0 bytes tests/cursors/win/none.png | Bin 2847 -> 0 bytes tests/cursors/win/nw-resize.png | Bin 993 -> 0 bytes tests/cursors/win/pointer.png | Bin 1178 -> 0 bytes tests/cursors/win/s-resize.png | Bin 722 -> 0 bytes tests/cursors/win/se-resize.png | Bin 993 -> 0 bytes tests/cursors/win/sw-resize.png | Bin 985 -> 0 bytes tests/cursors/win/text.png | Bin 258 -> 0 bytes tests/cursors/win/w-resize.png | Bin 714 -> 0 bytes tests/images/click.png | Bin 1293 -> 0 bytes tests/jquery.useraction.js | 347 -------------------------------------- tests/ui.testmouse.js | 142 ---------------- 55 files changed, 645 deletions(-) delete mode 100644 tests/autodrag.html delete mode 100644 tests/cursors/linux/auto.png delete mode 100644 tests/cursors/linux/crosshair.png delete mode 100644 tests/cursors/linux/default.png delete mode 100644 tests/cursors/linux/e-resize.png delete mode 100644 tests/cursors/linux/help.png delete mode 100644 tests/cursors/linux/move.png delete mode 100644 tests/cursors/linux/n-resize.png delete mode 100644 tests/cursors/linux/ne-resize.png delete mode 100644 tests/cursors/linux/none.cur delete mode 100644 tests/cursors/linux/none.png delete mode 100644 tests/cursors/linux/nw-resize.png delete mode 100644 tests/cursors/linux/pointer.png delete mode 100644 tests/cursors/linux/s-resize.png delete mode 100644 tests/cursors/linux/se-resize.png delete mode 100644 tests/cursors/linux/sw-resize.png delete mode 100644 tests/cursors/linux/text.png delete mode 100644 tests/cursors/linux/w-resize.png delete mode 100644 tests/cursors/mac/auto.png delete mode 100644 tests/cursors/mac/crosshair.png delete mode 100644 tests/cursors/mac/default.png delete mode 100644 tests/cursors/mac/e-resize.png delete mode 100644 tests/cursors/mac/help.png delete mode 100644 tests/cursors/mac/move.png delete mode 100644 tests/cursors/mac/n-resize.png delete mode 100644 tests/cursors/mac/ne-resize.png delete mode 100644 tests/cursors/mac/none.cur delete mode 100644 tests/cursors/mac/none.png delete mode 100644 tests/cursors/mac/nw-resize.png delete mode 100644 tests/cursors/mac/pointer.png delete mode 100644 tests/cursors/mac/s-resize.png delete mode 100644 tests/cursors/mac/se-resize.png delete mode 100644 tests/cursors/mac/sw-resize.png delete mode 100644 tests/cursors/mac/text.png delete mode 100644 tests/cursors/mac/w-resize.png delete mode 100644 tests/cursors/win/auto.png delete mode 100644 tests/cursors/win/crosshair.png delete mode 100644 tests/cursors/win/default.png delete mode 100644 tests/cursors/win/e-resize.png delete mode 100644 tests/cursors/win/help.png delete mode 100644 tests/cursors/win/move.png delete mode 100644 tests/cursors/win/n-resize.png delete mode 100644 tests/cursors/win/ne-resize.png delete mode 100644 tests/cursors/win/none.cur delete mode 100644 tests/cursors/win/none.png delete mode 100644 tests/cursors/win/nw-resize.png delete mode 100644 tests/cursors/win/pointer.png delete mode 100644 tests/cursors/win/s-resize.png delete mode 100644 tests/cursors/win/se-resize.png delete mode 100644 tests/cursors/win/sw-resize.png delete mode 100644 tests/cursors/win/text.png delete mode 100644 tests/cursors/win/w-resize.png delete mode 100644 tests/images/click.png delete mode 100644 tests/jquery.useraction.js delete mode 100644 tests/ui.testmouse.js (limited to 'tests') diff --git a/tests/autodrag.html b/tests/autodrag.html deleted file mode 100644 index 841bb026e..000000000 --- a/tests/autodrag.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - jQuery UI - Automated Tests - - - - - - - - - - - - - - - - -
- -

jQuery UI - Automated Tests

- -
- Status: Ready -
- -
- Test: -
- -
- -
- -
- -
- - - diff --git a/tests/cursors/linux/auto.png b/tests/cursors/linux/auto.png deleted file mode 100644 index 03ac2f281..000000000 Binary files a/tests/cursors/linux/auto.png and /dev/null differ diff --git a/tests/cursors/linux/crosshair.png b/tests/cursors/linux/crosshair.png deleted file mode 100644 index 30904f933..000000000 Binary files a/tests/cursors/linux/crosshair.png and /dev/null differ diff --git a/tests/cursors/linux/default.png b/tests/cursors/linux/default.png deleted file mode 100644 index 03ac2f281..000000000 Binary files a/tests/cursors/linux/default.png and /dev/null differ diff --git a/tests/cursors/linux/e-resize.png b/tests/cursors/linux/e-resize.png deleted file mode 100644 index b4c40ff17..000000000 Binary files a/tests/cursors/linux/e-resize.png and /dev/null differ diff --git a/tests/cursors/linux/help.png b/tests/cursors/linux/help.png deleted file mode 100644 index a6b5836d6..000000000 Binary files a/tests/cursors/linux/help.png and /dev/null differ diff --git a/tests/cursors/linux/move.png b/tests/cursors/linux/move.png deleted file mode 100644 index 39ae04520..000000000 Binary files a/tests/cursors/linux/move.png and /dev/null differ diff --git a/tests/cursors/linux/n-resize.png b/tests/cursors/linux/n-resize.png deleted file mode 100644 index afef5b438..000000000 Binary files a/tests/cursors/linux/n-resize.png and /dev/null differ diff --git a/tests/cursors/linux/ne-resize.png b/tests/cursors/linux/ne-resize.png deleted file mode 100644 index 8c5e970e1..000000000 Binary files a/tests/cursors/linux/ne-resize.png and /dev/null differ diff --git a/tests/cursors/linux/none.cur b/tests/cursors/linux/none.cur deleted file mode 100644 index 4f7970a9f..000000000 Binary files a/tests/cursors/linux/none.cur and /dev/null differ diff --git a/tests/cursors/linux/none.png b/tests/cursors/linux/none.png deleted file mode 100644 index 3b34811c5..000000000 Binary files a/tests/cursors/linux/none.png and /dev/null differ diff --git a/tests/cursors/linux/nw-resize.png b/tests/cursors/linux/nw-resize.png deleted file mode 100644 index 7c17be53e..000000000 Binary files a/tests/cursors/linux/nw-resize.png and /dev/null differ diff --git a/tests/cursors/linux/pointer.png b/tests/cursors/linux/pointer.png deleted file mode 100644 index b39fcef8f..000000000 Binary files a/tests/cursors/linux/pointer.png and /dev/null differ diff --git a/tests/cursors/linux/s-resize.png b/tests/cursors/linux/s-resize.png deleted file mode 100644 index afef5b438..000000000 Binary files a/tests/cursors/linux/s-resize.png and /dev/null differ diff --git a/tests/cursors/linux/se-resize.png b/tests/cursors/linux/se-resize.png deleted file mode 100644 index 7c17be53e..000000000 Binary files a/tests/cursors/linux/se-resize.png and /dev/null differ diff --git a/tests/cursors/linux/sw-resize.png b/tests/cursors/linux/sw-resize.png deleted file mode 100644 index 8c5e970e1..000000000 Binary files a/tests/cursors/linux/sw-resize.png and /dev/null differ diff --git a/tests/cursors/linux/text.png b/tests/cursors/linux/text.png deleted file mode 100644 index 85a54fcb7..000000000 Binary files a/tests/cursors/linux/text.png and /dev/null differ diff --git a/tests/cursors/linux/w-resize.png b/tests/cursors/linux/w-resize.png deleted file mode 100644 index b4c40ff17..000000000 Binary files a/tests/cursors/linux/w-resize.png and /dev/null differ diff --git a/tests/cursors/mac/auto.png b/tests/cursors/mac/auto.png deleted file mode 100644 index 65b21e435..000000000 Binary files a/tests/cursors/mac/auto.png and /dev/null differ diff --git a/tests/cursors/mac/crosshair.png b/tests/cursors/mac/crosshair.png deleted file mode 100644 index b4f165b6a..000000000 Binary files a/tests/cursors/mac/crosshair.png and /dev/null differ diff --git a/tests/cursors/mac/default.png b/tests/cursors/mac/default.png deleted file mode 100644 index 65b21e435..000000000 Binary files a/tests/cursors/mac/default.png and /dev/null differ diff --git a/tests/cursors/mac/e-resize.png b/tests/cursors/mac/e-resize.png deleted file mode 100644 index 583ce1862..000000000 Binary files a/tests/cursors/mac/e-resize.png and /dev/null differ diff --git a/tests/cursors/mac/help.png b/tests/cursors/mac/help.png deleted file mode 100644 index 5e8ee5870..000000000 Binary files a/tests/cursors/mac/help.png and /dev/null differ diff --git a/tests/cursors/mac/move.png b/tests/cursors/mac/move.png deleted file mode 100644 index cf7608539..000000000 Binary files a/tests/cursors/mac/move.png and /dev/null differ diff --git a/tests/cursors/mac/n-resize.png b/tests/cursors/mac/n-resize.png deleted file mode 100644 index 1242980a4..000000000 Binary files a/tests/cursors/mac/n-resize.png and /dev/null differ diff --git a/tests/cursors/mac/ne-resize.png b/tests/cursors/mac/ne-resize.png deleted file mode 100644 index da3f6d05f..000000000 Binary files a/tests/cursors/mac/ne-resize.png and /dev/null differ diff --git a/tests/cursors/mac/none.cur b/tests/cursors/mac/none.cur deleted file mode 100644 index 4f7970a9f..000000000 Binary files a/tests/cursors/mac/none.cur and /dev/null differ diff --git a/tests/cursors/mac/none.png b/tests/cursors/mac/none.png deleted file mode 100644 index 3b34811c5..000000000 Binary files a/tests/cursors/mac/none.png and /dev/null differ diff --git a/tests/cursors/mac/nw-resize.png b/tests/cursors/mac/nw-resize.png deleted file mode 100644 index b6c5e3956..000000000 Binary files a/tests/cursors/mac/nw-resize.png and /dev/null differ diff --git a/tests/cursors/mac/pointer.png b/tests/cursors/mac/pointer.png deleted file mode 100644 index 45fbd2b77..000000000 Binary files a/tests/cursors/mac/pointer.png and /dev/null differ diff --git a/tests/cursors/mac/s-resize.png b/tests/cursors/mac/s-resize.png deleted file mode 100644 index 1242980a4..000000000 Binary files a/tests/cursors/mac/s-resize.png and /dev/null differ diff --git a/tests/cursors/mac/se-resize.png b/tests/cursors/mac/se-resize.png deleted file mode 100644 index b6c5e3956..000000000 Binary files a/tests/cursors/mac/se-resize.png and /dev/null differ diff --git a/tests/cursors/mac/sw-resize.png b/tests/cursors/mac/sw-resize.png deleted file mode 100644 index da3f6d05f..000000000 Binary files a/tests/cursors/mac/sw-resize.png and /dev/null differ diff --git a/tests/cursors/mac/text.png b/tests/cursors/mac/text.png deleted file mode 100644 index 2257903e9..000000000 Binary files a/tests/cursors/mac/text.png and /dev/null differ diff --git a/tests/cursors/mac/w-resize.png b/tests/cursors/mac/w-resize.png deleted file mode 100644 index 583ce1862..000000000 Binary files a/tests/cursors/mac/w-resize.png and /dev/null differ diff --git a/tests/cursors/win/auto.png b/tests/cursors/win/auto.png deleted file mode 100644 index b2c5c858c..000000000 Binary files a/tests/cursors/win/auto.png and /dev/null differ diff --git a/tests/cursors/win/crosshair.png b/tests/cursors/win/crosshair.png deleted file mode 100644 index 02c99b7fd..000000000 Binary files a/tests/cursors/win/crosshair.png and /dev/null differ diff --git a/tests/cursors/win/default.png b/tests/cursors/win/default.png deleted file mode 100644 index b2c5c858c..000000000 Binary files a/tests/cursors/win/default.png and /dev/null differ diff --git a/tests/cursors/win/e-resize.png b/tests/cursors/win/e-resize.png deleted file mode 100644 index 056eb699f..000000000 Binary files a/tests/cursors/win/e-resize.png and /dev/null differ diff --git a/tests/cursors/win/help.png b/tests/cursors/win/help.png deleted file mode 100644 index b8034bb7b..000000000 Binary files a/tests/cursors/win/help.png and /dev/null differ diff --git a/tests/cursors/win/move.png b/tests/cursors/win/move.png deleted file mode 100644 index 627e79937..000000000 Binary files a/tests/cursors/win/move.png and /dev/null differ diff --git a/tests/cursors/win/n-resize.png b/tests/cursors/win/n-resize.png deleted file mode 100644 index d06244cbb..000000000 Binary files a/tests/cursors/win/n-resize.png and /dev/null differ diff --git a/tests/cursors/win/ne-resize.png b/tests/cursors/win/ne-resize.png deleted file mode 100644 index 79f6c3ae3..000000000 Binary files a/tests/cursors/win/ne-resize.png and /dev/null differ diff --git a/tests/cursors/win/none.cur b/tests/cursors/win/none.cur deleted file mode 100644 index 4f7970a9f..000000000 Binary files a/tests/cursors/win/none.cur and /dev/null differ diff --git a/tests/cursors/win/none.png b/tests/cursors/win/none.png deleted file mode 100644 index 1764445c9..000000000 Binary files a/tests/cursors/win/none.png and /dev/null differ diff --git a/tests/cursors/win/nw-resize.png b/tests/cursors/win/nw-resize.png deleted file mode 100644 index af48a12d2..000000000 Binary files a/tests/cursors/win/nw-resize.png and /dev/null differ diff --git a/tests/cursors/win/pointer.png b/tests/cursors/win/pointer.png deleted file mode 100644 index 7d07182a9..000000000 Binary files a/tests/cursors/win/pointer.png and /dev/null differ diff --git a/tests/cursors/win/s-resize.png b/tests/cursors/win/s-resize.png deleted file mode 100644 index d06244cbb..000000000 Binary files a/tests/cursors/win/s-resize.png and /dev/null differ diff --git a/tests/cursors/win/se-resize.png b/tests/cursors/win/se-resize.png deleted file mode 100644 index af48a12d2..000000000 Binary files a/tests/cursors/win/se-resize.png and /dev/null differ diff --git a/tests/cursors/win/sw-resize.png b/tests/cursors/win/sw-resize.png deleted file mode 100644 index 79f6c3ae3..000000000 Binary files a/tests/cursors/win/sw-resize.png and /dev/null differ diff --git a/tests/cursors/win/text.png b/tests/cursors/win/text.png deleted file mode 100644 index ce8dc22ee..000000000 Binary files a/tests/cursors/win/text.png and /dev/null differ diff --git a/tests/cursors/win/w-resize.png b/tests/cursors/win/w-resize.png deleted file mode 100644 index 056eb699f..000000000 Binary files a/tests/cursors/win/w-resize.png and /dev/null differ diff --git a/tests/images/click.png b/tests/images/click.png deleted file mode 100644 index 2b32f8d84..000000000 Binary files a/tests/images/click.png and /dev/null differ diff --git a/tests/jquery.useraction.js b/tests/jquery.useraction.js deleted file mode 100644 index 82ec0cd22..000000000 --- a/tests/jquery.useraction.js +++ /dev/null @@ -1,347 +0,0 @@ -/* Copyright (c) 2007 Eduardo Lundgren (eduardolundgren@gmail.com) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - * Version: 0.1a - * Date: May, 2008 - * Requires jQuery 1.2.x+ - * Docs: http://docs.jquery.com/Plugins/userAction - * Greetings: Richard Worth - */ - -;(function($) { - -$.fn.extend({ - userAction: function(type) { - var args = arguments, opts = {}, a1 = args[1], a2 = args[2]; - - // transfer center offset - if (a1 && a1.length) { - opts.center = [a1[0], a1[1]]; - } - // set x and y - else if (typeof a1 == StringPool.NUMBER) { - opts.x = a1; opts.y = a2; - } - // extend options - else { - $.extend(opts, a1); - } - - return this.each(function() { - new $.userAction(this, type, opts); - }); - } -}); - -$.userAction = function(el, type, options) { - this.type = type; - this.options = $.extend({}, $.userAction.defaults, options || {}); - this.target = $(this.options.target || el)[0]; - - var self = this, o = this.options, c = o.center, center = { x: 0, y: 0 }; - - if (!o.x && !o.y) { - center = this.findCenter( - c && c.length ? c : [0, 0] - ) - } - - // if x and y not set, get the center of the element - o.x = o.x || center.x; o.y = o.y || center.y; - - var EVENT_DEFAULT = { - target: this.target, - view: window, - bubbles: o.bubbles || true, - cancelable: o.cancelable || false, - ctrlKey: o.ctrlKey || false, - altKey: o.altKey || false, - shiftKey: o.shiftKey || false, - metaKey: o.metaKey || false - }; - - // Simulating drag and drop event - if (/^drag$/i.test(type)) { - var self = this, t = this.target, queue = $.data(t, StringPool.DATA_QUEUE), - data = [options.dx || options.x, options.dy || options.y, this]; - - var fire = function() { - self.drag(options.dx || options.x, options.dy || options.y); - }; - - if (/^sync$/i.test(o.speed)) { - fire(); return; - } - - if (!queue) { - $.data(t, StringPool.DATA_QUEUE, [data]); fire(); return; - } - // queuing drags... - if (queue && queue.length) { - queue.push(data); - } - // if drag, stop here. - return; - } - - var isMouse = /^mouse(over|out|down|up|move)|(dbl)?click$/i.test(type), - isKeyboard = /^textevent|key(up|down|press)$/i.test(type), - - EVT = isMouse ? - $.extend({}, EVENT_DEFAULT, { - clientX: o.x, clientY: o.y, - screenX: o.screenX || 0, screenY: o.screenY || 0, - relatedTarget: $(o.relatedTarget)[0] || null, detail: 0, - button: o.button || ($.browser.msie ? 1 : 0), isTrusted: false - }) : - $.extend({}, EVENT_DEFAULT, { - keyCode: o.keyCode || 0, charCode: o.charCode || 0 - }); - - // avoid e.type == undefined before dispatchment - EVT.type = type; - - if (o.before) o.before.apply(this.target, [$.event.fix(EVT), o.x, o.y, this]); - - // check event type for mouse events - if (isMouse) { - // simulating mouse event - EVT = this.mouseEvent(EVT) - } - - // check event type for key events - if (isKeyboard) { - // simulating keuboard event - EVT = this.keyboardEvent(EVT); - } - - if (o.after) o.after.apply(this.target, [$.event.fix(EVT), o.x, o.y, this]); -}; - -$.extend($.userAction.prototype, { - - down: function(target) { - $(target).userAction(StringPool.MOUSEOVER).userAction(StringPool.MOUSEDOWN) - .userAction(StringPool.MOUSEMOVE); - }, - - up: function(target) { - $(target).userAction(StringPool.MOUSEUP).userAction(StringPool.MOUSEOUT); - }, - - move: function(target, x, y, after) { - $(target).userAction(StringPool.MOUSEMOVE, { x: x, y: y, after: after }); - }, - - drag: function(dx, dy) { - // drag helper function, thanks Richard Worth's testmouse api. - var self = this, o = this.options, center = this.findCenter(), - target = $(this.target), lastx = center.x, lasty = center.y, - fake = $(StringPool.FAKE_CURSOR_EXP), - speed = o.speed || StringPool.SLOW, - easing = o.easing || StringPool.SWING; - - var complete = function() { - // fire complete or after cb - if (o.after||o.complete) (o.after||o.complete).apply(self.target, [o, self]); - }; - - // drag synchronously - if (/^sync$/i.test(o.speed)) { - self.down(target); - - var mdx = Math.abs(dx)||0, mdy = Math.abs(dy)||0, range = Math.max(mdx, mdy), - sx = dx/mdx||1, sy = dy/mdy||1; - - for (var dt = 1; dt <= range; dt++) { - var x = center.x + sx*(dt <= mdx ? dt : 0), y = center.y + sy*(dt <= mdy ? dt : 0); - this.move(target, x, y, o.drag); - } - self.up(target); - complete(); - return; - } - - // drag asynchronously - animated - fake = fake.size() ? fake : - $(StringPool.FAKE_CURSOR_DIV) - .css({ position: StringPool.ABSOLUTE }).appendTo(document.body); - - fake - .animate({ left: center.x, top: center.y }, speed, easing, function(){ - self.down(target); - }) - .animate({ left: center.x + (dx||0), top: center.y + (dy||0) }, { - speed: speed, - easing: easing, - step: function(i, anim) { - lastx = anim.prop == StringPool.LEFT ? i : lastx; - lasty = anim.prop == StringPool.TOP ? i : lasty; - self.move(target, lastx, lasty, o.drag); - }, - complete: function() { - - self.up(target); - - // remove fake cursor - $(this).remove(); - - complete(); - - // trigger drag queue - var queue = $.data(self.target, StringPool.DATA_QUEUE); - if (queue) queue.shift(); - - if (queue && queue[0]) { - // trigger drag on correct instance - queue[0][2].drag(queue[0][0], queue[0][1]); - } - else - $.removeData(self.target, StringPool.DATA_QUEUE); - } - }); - }, - - mouseEvent: function(EVT) { - var evt, type = this.type, o = this.options; - - //check for DOM-compliant browsers - if ($.isFunction(document.createEvent)) { - evt = document.createEvent(StringPool.MOUSE_EVENTS); - - //Safari 2.x doesn't implement initMouseEvent() - if ($.isFunction(evt.initMouseEvent)) { - evt.initMouseEvent(type, - EVT.bubbles, EVT.cancelable, EVT.view, EVT.detail, - EVT.screenX, EVT.screenY, EVT.clientX, EVT.clientY, - EVT.ctrlKey, EVT.altKey, EVT.shiftKey, EVT.metaKey, - EVT.button, EVT.relatedTarget); - } else { - // Safari - evt = document.createEvent(StringPool.UI_EVENTS); - customEvent.initEvent(type, EVT.bubbles, EVT.cancelable); - $.extend(evt, EVT); - } - - // check to see if relatedTarget has been assigned - if (EVT.relatedTarget && !evt.relatedTarget){ - if (type == StringPool.MOUSEOUT) { - evt.toElement = EVT.relatedTarget; - } else if (type == StringPool.MOUSEOVER) { - evt.fromElement = EVT.relatedTarget; - } - } - // fire the event - this.target.dispatchEvent(evt); - - } else if (document.createEventObject) { - evt = document.createEventObject(); - - // assign available properties - $.extend(evt, EVT) - - // IE won't allow assignment to toElement or fromElement - evt.relatedTarget = EVT.relatedTarget; - - // fix for 2 pixels bug from mousecords - evt.pageX = o.x; evt.pageY = o.y; - - // fire the event - this.target.fireEvent(StringPool.ON + type, evt); - } - - return evt; - }, - - keyboardEvent: function(EVT) { - var evt, type = this.type, o = this.options; - - // check for DOM-compliant browsers first - if ($.isFunction(document.createEvent)) { - - try { - // try to create key event - evt = document.createEvent(StringPool.KEY_EVENTS); - - evt.initKeyEvent(type, - EVT.bubbles, EVT.cancelable, EVT.view, EVT.ctrlKey, - EVT.altKey, EVT.shiftKey, EVT.metaKey, EVT.keyCode, EVT.charCode); - - } catch (err) { - // we need another try-catch for Safari 2.x - try { - // generic event for opera and webkit nightlies, will fail in Safari 2.x - evt = document.createEvent(StringPool.EVENTS); - } catch (ierr){ - // Safari 2.x - create a UIEvent - evt = document.createEvent(StringPool.UI_EVENTS); - } finally { - evt.initEvent(type, EVT.bubbles, EVT.cancelable); - - // initializing - $.each(EVT, function(k, v) { - // using try-catch for avoiding Opera NO_MODIFICATION_ALLOWED_ERR - try { evt[k] = v; } catch(e) { } - }); - } - } - - // fire the event - this.target.dispatchEvent(evt); - - } else if (document.createEventObject) { - // create an IE event object - evt = document.createEventObject(); - - // assign available properties - $.extend(evt, EVT); - - // IE doesn't support charCode explicitly - evt.keyCode = (EVT.charCode > 0) ? EVT.charCode : EVT.keyCode; - - // fire the event - this.target.fireEvent(StringPool.ON + type, evt); - } - - return evt; - }, - - findCenter: function(offset) { - var el = $(this.target), o = el.offset(); - return { - x: o.left + (((offset||[0, 0])[0]) || 0) + el.outerWidth() / 2, - y: o.top + (((offset||[0, 0])[1]) || 0) + el.outerHeight() / 2 - }; - } -}); - -$.extend($.userAction, { - defaults: { - center: true - } -}); - -var StringPool = { - ON: 'on', - NUMBER: 'number', - MOUSEOVER: 'mouseover', - MOUSEOUT: 'mouseout', - MOUSEDOWN: 'mousedown', - MOUSEUP: 'mouseup', - MOUSEMOVE: 'mousemove', - MOUSE_EVENTS: 'MouseEvents', - UI_EVENTS: 'UIEvents', - KEY_EVENTS: 'KeyEvents', - EVENTS: 'Events', - FAKE_CURSOR_EXP: 'div.ui-fake-cursor', - FAKE_CURSOR_DIV: '
', - ABSOLUTE: 'absolute', - DATA_QUEUE: 'ua-drag-queue', - TOP: 'top', - LEFT: 'left', - SLOW: 'slow', - SWING: 'swing' -}; - -})(jQuery); \ No newline at end of file diff --git a/tests/ui.testmouse.js b/tests/ui.testmouse.js deleted file mode 100644 index 5c4d41204..000000000 --- a/tests/ui.testmouse.js +++ /dev/null @@ -1,142 +0,0 @@ -/* - * jQuery UI testMouse - * - * Copyright (c) 2008 Richard D. Worth (rdworth.org) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * Revision: $Id: $ - */ -;(function($) { - - var mouseX = 0; - var mouseY = 0; - - $(function() { - $(document).mousemove(function(e) { - if (e.isTrusted !== false) { - mouseX = e.pageX; - mouseY = e.pageY; - } - }); - }); - - $.widget("ui.testMouse", { - trackMouse: function() {}, - init: function() { - }, - destroy: function() { - }, - center: function(offset) { - var o = this.element.offset(); - return { - x: (o.left + (offset || [0, 0])[0] || 0) + this.element.width() / 2, - y: (o.top + (offset || [0, 0])[1] || 0) + this.element.height() / 2 - }; - }, - drag: function(dx, dy) { - var self = this; - - var center = this.center(); - this.left = center.x; - this.top = center.y; - - var OS = (/(win|mac|linux)/i.exec(navigator.platform) || ['other'])[0].toLowerCase(); - - var defaultUrl = ['cursors', OS == 'other' ? 'win' : OS, 'default.png'].join('/'); - var cursorUrl = function() { - return ['cursors', OS == 'other' ? 'win' : OS, self.element.css('cursor') + '.png'].join('/'); - } - var noneUrl = ['cursors', OS == 'other' ? 'win' : OS, 'none' + ($.browser.safari ? '.png' : '.cur')].join('/'); - - var fakemouse = $(''); - var realmouse = $(''); - if ($.browser.msie && $.browser.version == 6) { - fakemouse = $('
'); - realmouse = $('
'); - } - var mousescreen = $('
'); - - var updateCursor = function() { - if ($.browser.msie && $.browser.version == 6) { - fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + cursorUrl() + '\', sizingMethod=\'scale\''); - } else { - fakemouse.attr('src', cursorUrl()); - } - } - var resetCursor = function() { - if ($.browser.msie && $.browser.version == 6) { - fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\''); - } else { - fakemouse.attr('src', defaultUrl); - } - } - - var testStart = function() { - self.element.bind("mouseover", updateCursor).bind("mouseout", resetCursor); - fakemouse.appendTo('body').css({ position: 'absolute', left: mouseX, top: mouseY, zIndex: 5000 }); - realmouse.appendTo('body').css({ position: 'absolute', left: mouseX, top: mouseY, zIndex: 5000, opacity: 0.1 }); - mousescreen.appendTo('body').css({ width: '100%', height: '100%', position: 'absolute', top: 0, left: 0, zIndex: 5000 }) - .mousemove(function(e) { realmouse.css({ left: e.pageX, top: e.pageY }); return false; }) - .mousedown(function() { return false; }) - .mouseup(function() { return false; }); - mousescreen.css('cursor', 'url(' + noneUrl + '), crosshair'); - ($.browser.opera && mousescreen.css('cursor', 'crosshair')); - } - var testStop = function() { - self.element.unbind("mouseover", updateCursor).unbind("mouseout", resetCursor); - mousescreen.remove(); - mouseX = realmouse.css("left"); - mouseY = realmouse.css("top"); - realmouse.remove(); - fakemouse.remove(); - self.options.complete.apply(); - } - - testStart(); - - this.lastX = null; - - var before = function() { - self.element.triggerHandler('mouseover'); - self.element.simulate("mousedown", { clientX: self.left, clientY: self.top }); - self.element.simulate("mousemove", { clientX: self.left, clientY: self.top }); - } - - var during = function(xory) { - if (!self.lastX) { - self.lastX = xory; - } else { - var x = self.lastX, y = xory; - self.element.simulate("mousemove", { clientX: x, clientY: y }); - self.lastX = null; - } - } - - var after = function() { - self.element.triggerHandler('mouseout'); - self.element.simulate("mouseup", { clientX: 0, clientY: 0 }); - testStop(); - } - - fakemouse - .animate({ left: this.left, top: this.top }, this.options.speed, before) - .animate({ left: this.left + dx, top: this.top + dy }, { - speed: this.options.speed, - easing: "swing", - step: during - }) - .animate({ left: this.left + dx, top: this.top + dy }, { - speed: this.options.speed, - easing: "swing", - complete: after - }); - - } - }); - - $.ui.testMouse.defaults = { - speed: "slow" - } - -})(jQuery); -- cgit v1.2.3