From 542bbbb4736e921bdfa6ba3b1e7ad2383a73b3c3 Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Sat, 8 Nov 2008 22:30:02 +0000 Subject: moved magnifier to experimental branch --- demos/functional/index.html | 2 - demos/functional/templates/ui.magnifier.html | 52 -------- tests/visual/magnifier.html | 107 ---------------- ui/ui.magnifier.js | 176 --------------------------- 4 files changed, 337 deletions(-) delete mode 100644 demos/functional/templates/ui.magnifier.html delete mode 100644 tests/visual/magnifier.html delete mode 100644 ui/ui.magnifier.js diff --git a/demos/functional/index.html b/demos/functional/index.html index 36b8b51da..4db5b39d9 100644 --- a/demos/functional/index.html +++ b/demos/functional/index.html @@ -64,7 +64,6 @@ - @@ -222,7 +221,6 @@
  • Colorpicker
  • Datepicker
  • Dialog
  • -
  • Magnifier
  • Progressbar
  • Slider
  • Spinner
  • diff --git a/demos/functional/templates/ui.magnifier.html b/demos/functional/templates/ui.magnifier.html deleted file mode 100644 index fddef3d6b..000000000 --- a/demos/functional/templates/ui.magnifier.html +++ /dev/null @@ -1,52 +0,0 @@ - \ No newline at end of file diff --git a/tests/visual/magnifier.html b/tests/visual/magnifier.html deleted file mode 100644 index 39d8fe96c..000000000 --- a/tests/visual/magnifier.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - -Magnifier Demo - - - - - - - - - - -

    1. Default, no options

    -
    -
    - - - - - - -
    -
    - -

    2. Magnification set to 1.5 (default: 2)

    -
    -
    - - - - - - -
    -
    - -

    3. Advanced example: overlap: true, zIndex: 10, opacity: { min: 0.6, max: 1 }, baseline: -1

    -
    -
    - - - - - - -
    -
    - -

    4. Advanced example: The direction doesn't have to be horizontal!

    -
    -
    - - - - - - - - - -
    -
    - - - - diff --git a/ui/ui.magnifier.js b/ui/ui.magnifier.js deleted file mode 100644 index c3e3d526e..000000000 --- a/ui/ui.magnifier.js +++ /dev/null @@ -1,176 +0,0 @@ -/* - * jQuery UI Magnifier @VERSION - * - * Copyright (c) 2008 jQuery - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Magnifier - * - * Depends: - * ui.core.js - */ -(function($) { - -var counter = 0; - -$.widget("ui.magnifier", { - _init: function() { - var self = this, - o = this.options; - - this.element - .addClass("ui-magnifier") - .bind('click.magnifier', function(e) { - (!self.disabled && o.click && o.click.apply(this, [e, { - options: self.options, - current: self.current[0], - currentOffset: self.current[1] - }])); - }); - - // the element must have relative or absolute positioning - if (!(/^(r|a)/).test(this.element.css("position"))) { - this.element.css("position", "relative"); - } - - this.items = []; - this.element.find(o.items).each(function() { - var $this = $(this); - // TODO: use a hash so references to this data is readable - self.items.push([ - this, - $this.offset(), - [$this.width(),$this.height()], - (o.overlap ? $this.position() : null) - ]); - - (o.opacity && $this.css('opacity', o.opacity.min)); - }); - - // absolutize - (o.overlap && $.each(this.items, function() { - $(this[0]).css({ - position: "absolute", - top: this[3].top, - left: this[3].left - }); - })); - - this.identifier = ++counter; - $(document).bind("mousemove.magnifier"+this.identifier, function(e) { - (self.disabled || self._magnify.apply(self, [e])); - }); - - this.pp = this.element.offset(); - }, - - destroy: function() { - this.reset(); - this.element - .removeClass("ui-magnifier ui-magnifier-disabled") - .unbind(".magnifier"); - $(document).unbind("mousemove.magnifier"+this.identifier); - }, - - disable: function() { - this.reset(); - $.widget.prototype.disable.apply(this, arguments); - }, - - reset: function(e) { - var o = this.options; - - $.each(this.items, function() { - var item = this; - $(item[0]).css({ - width: item[2][0], - height: item[2][1], - top: (item[3] ? item[3].top : 0), - left: (item[3] ? item[3].left : 0) - }); - - (o.opacity && $(item[0]).css('opacity', o.opacity.min)); - (o.zIndex && $(item[0]).css("z-index", "")); - }); - }, - - _magnify: function(e) { - var p = [e.pageX,e.pageY], o = this.options, c, distance = 1; - this.current = this.items[0]; - - // Compute the parent's distance - // we don't need to fire anything if we are not near the parent - var overlap = ((p[0] > this.pp.left-o.distance) && - (p[0] < this.pp.left + this.element[0].offsetWidth + o.distance) && - (p[1] > this.pp.top-o.distance) && - (p[1] < this.pp.top + this.element[0].offsetHeight + o.distance)); - if (!overlap) { return false; } - - for (var i=0; i *" - } -}); - -})(jQuery); -- cgit v1.2.3