]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
rolling back to imgareaselect 0.7 because of problem with borders - perhaps ias 0...
authorCash Costello <cash.costello@gmail.com>
Mon, 8 Jun 2009 12:08:16 +0000 (12:08 +0000)
committerCash Costello <cash.costello@gmail.com>
Mon, 8 Jun 2009 12:08:16 +0000 (12:08 +0000)
vendors/jquery.imgareaselect-0.7.js [new file with mode: 0644]
vendors/jquery.imgareaselect-0.8.js [deleted file]
views/default/js/tagging.php

diff --git a/vendors/jquery.imgareaselect-0.7.js b/vendors/jquery.imgareaselect-0.7.js
new file mode 100644 (file)
index 0000000..3adac1d
--- /dev/null
@@ -0,0 +1,614 @@
+/*\r
+ * imgAreaSelect jQuery plugin\r
+ * version 0.7\r
+ *\r
+ * Copyright (c) 2008-2009 Michal Wojciechowski (odyniec.net)\r
+ *\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt) \r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://odyniec.net/projects/imgareaselect/\r
+ *\r
+ */\r
+\r
+jQuery.imgAreaSelect = { onKeyPress: null };\r
+\r
+jQuery.imgAreaSelect.init = function (img, options) {\r
+    var $img = jQuery(img), $area = jQuery('<div />'),\r
+        $border1 = jQuery('<div />'), $border2 = jQuery('<div />'),\r
+        $areaOver = jQuery('<div />'), $areaOver2,\r
+        $outLeft = jQuery('<div />'), $outTop = jQuery('<div />'),\r
+        $outRight = jQuery('<div />'), $outBottom = jQuery('<div />'),\r
+        $handles, handleWidth, handles = [ ],\r
+        left, top, imgOfs, imgWidth, imgHeight, parent, parOfs, parScroll,\r
+        zIndex = 0, position = 'absolute', $p, startX, startY, moveX, moveY,\r
+        resizeMargin = 10, resize = [ ], V = 0, H = 1,\r
+        keyDown, d, aspectRatio, x1, x2, y1, y2, x, y, adjusted,\r
+        selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 };\r
+\r
+    var $a = $area.add($border1).add($border2).add($areaOver);\r
+    var $o = $outLeft.add($outTop).add($outRight).add($outBottom);\r
+\r
+    function viewX(x)\r
+    {\r
+        return x + imgOfs.left + parScroll.left - parOfs.left;\r
+    }\r
+\r
+    function viewY(y)\r
+    {\r
+        return y + imgOfs.top + parScroll.top - parOfs.top;\r
+    }\r
+\r
+    function selX(x)\r
+    {\r
+        return x - imgOfs.left - parScroll.left + parOfs.left;\r
+    }\r
+\r
+    function selY(y)\r
+    {\r
+        return y - imgOfs.top - parScroll.top + parOfs.top;\r
+    }\r
+\r
+    function evX(event)\r
+    {\r
+        return event.pageX + parScroll.left - parOfs.left;\r
+    }\r
+\r
+    function evY(event)\r
+    {\r
+        return event.pageY + parScroll.top - parOfs.top;\r
+    }\r
+\r
+    function getZIndex()\r
+    {\r
+        $p = $img;\r
+\r
+        while ($p.length && !$p.is('body')) {\r
+            if (!isNaN($p.css('z-index')) && $p.css('z-index') > zIndex)\r
+                zIndex = $p.css('z-index');\r
+            if ($p.css('position') == 'fixed')\r
+                position = 'fixed';\r
+\r
+            $p = $p.parent();\r
+        }\r
+    }\r
+\r
+    function adjust()\r
+    {\r
+        imgOfs = $img.offset();\r
+        imgOfs.left = parseInt(imgOfs.left) + parseInt($img.css("border-left-width")) + parseInt($img.css("padding-left"));\r
+        imgOfs.top = parseInt(imgOfs.top) + parseInt($img.css("border-top-width")) + parseInt($img.css("padding-top"));\r
+        imgWidth = $img.width();\r
+        imgHeight = $img.height(); \r
+\r
+        if (jQuery(parent).is('body'))\r
+            parOfs = parScroll = { left: 0, top: 0 };\r
+        else {\r
+            parOfs = jQuery(parent).offset();\r
+            parScroll = { left: parent.scrollLeft, top: parent.scrollTop };\r
+        }\r
+\r
+        left = viewX(0);\r
+        top = viewY(0);\r
+    }\r
+\r
+    function update(resetKeyPress)\r
+    {\r
+        $a.css({\r
+            left: viewX(selection.x1) + 'px',\r
+            top: viewY(selection.y1) + 'px',\r
+            width: Math.max(selection.width - options.borderWidth * 2, 0) + 'px',\r
+            height: Math.max(selection.height - options.borderWidth * 2, 0) + 'px'\r
+        });\r
+        $areaOver.css({ width: selection.width + 'px', height: selection.height + 'px' });\r
+        $outLeft.css({ left: left + 'px', top: top + 'px',\r
+            width: selection.x1 + 'px', height: imgHeight + 'px' });\r
+        $outTop.css({ left: left + selection.x1 + 'px', top: top + 'px',\r
+            width: selection.width + 'px', height: selection.y1 + 'px' });\r
+        $outRight.css({ left: left + selection.x2 + 'px', top: top + 'px',\r
+            width: imgWidth - selection.x2 + 'px', height: imgHeight + 'px' });\r
+        $outBottom.css({ left: left + selection.x1 + 'px', top: top + selection.y2 + 'px',\r
+            width: selection.width + 'px', height: imgHeight - selection.y2 + 'px' });\r
+\r
+        if ($handles) {\r
+            handles[0].css({ left: viewX(selection.x1) + 'px',\r
+                top: viewY(selection.y1) + 'px' });\r
+            handles[1].css({ left: viewX(selection.x2 - handleWidth) + 'px',\r
+                top: viewY(selection.y1) + 'px' });\r
+            handles[2].css({ left: viewX(selection.x1) + 'px',\r
+                top: viewY(selection.y2 - handleWidth) + 'px' });\r
+            handles[3].css({ left: viewX(selection.x2 - handleWidth) + 'px',\r
+                top: viewY(selection.y2 - handleWidth) + 'px' });\r
+\r
+            if (handles.length == 8) {\r
+                handles[4].css({ left: viewX(selection.x1 + (selection.width -\r
+                    handleWidth) / 2) + 'px', top: viewY(selection.y1) + 'px' });\r
+                handles[5].css({ left: viewX(selection.x1) + 'px', top: \r
+                    viewY(selection.y1 + (selection.height - handleWidth) / 2) + 'px' });\r
+                handles[6].css({ left: viewX(selection.x1 + (selection.width - handleWidth)\r
+                    / 2) + 'px', top: viewY(selection.y2 - handleWidth) + 'px' });\r
+                handles[7].css({ left: viewX(selection.x2 - handleWidth) + 'px', top:\r
+                    viewY(selection.y1 + (selection.height - handleWidth) / 2) + 'px' });\r
+            }\r
+\r
+            for (var i = 0; i < handles.length; i++) {\r
+                if (selX(parseInt(handles[i].css('left'))) < 0)\r
+                    handles[i].css('left', viewX(0) + 'px');\r
+                if (selX(parseInt(handles[i].css('left'))) > imgWidth - handleWidth)\r
+                    handles[i].css('left', viewX(imgWidth - handleWidth) + 'px');\r
+                if (selY(parseInt(handles[i].css('top'))) < 0)\r
+                    handles[i].css('top', viewY(0) + 'px');\r
+                if (selY(parseInt(handles[i].css('top'))) > imgHeight - handleWidth)\r
+                    handles[i].css('top', viewY(imgHeight - handleWidth) + 'px');\r
+            }\r
+        }\r
+\r
+        if (resetKeyPress !== false) {\r
+            if (jQuery.imgAreaSelect.keyPress != docKeyPress)\r
+                jQuery(document).unbind(jQuery.imgAreaSelect.keyPress,\r
+                    jQuery.imgAreaSelect.onKeyPress);\r
+\r
+            if (options.keys)\r
+                jQuery(document).bind(jQuery.imgAreaSelect.keyPress,\r
+                    jQuery.imgAreaSelect.onKeyPress = docKeyPress);\r
+        }\r
+    }\r
+\r
+    function areaMouseMove(event)\r
+    {\r
+        if (!adjusted) {\r
+            adjust();\r
+            adjusted = true;\r
+\r
+            $a.one('mouseout', function () { adjusted = false; });\r
+        }\r
+\r
+        x = selX(evX(event)) - selection.x1;\r
+        y = selY(evY(event)) - selection.y1;\r
+\r
+        resize = [ ];\r
+\r
+        if (options.resizable) {\r
+            if (y <= resizeMargin)\r
+                resize[V] = 'n';\r
+            else if (y >= selection.height - resizeMargin)\r
+                resize[V] = 's';\r
+            if (x <= resizeMargin)\r
+                resize[H] = 'w';\r
+            else if (x >= selection.width - resizeMargin)\r
+                resize[H] = 'e';\r
+        }\r
+\r
+        $areaOver.css('cursor', resize.length ? resize.join('') + '-resize' :\r
+            options.movable ? 'move' : '');\r
+        if ($areaOver2)\r
+            $areaOver2.toggle();\r
+    }\r
+\r
+    function areaMouseDown(event)\r
+    {\r
+        if (event.which != 1) return false;\r
+\r
+        adjust();\r
+\r
+        if (options.resizable && resize.length > 0) {\r
+            jQuery('body').css('cursor', resize.join('') + '-resize');\r
+\r
+            x1 = viewX(selection[resize[H] == 'w' ? 'x2' : 'x1']);\r
+            y1 = viewY(selection[resize[V] == 'n' ? 'y2' : 'y1']);\r
+\r
+            jQuery(document).mousemove(selectingMouseMove);\r
+            $areaOver.unbind('mousemove', areaMouseMove);\r
+\r
+            jQuery(document).one('mouseup', function () {\r
+                resize = [ ];\r
+\r
+                jQuery('body').css('cursor', '');\r
+\r
+                if (options.autoHide || selection.width == 0 || selection.height == 0)\r
+                    $a.add($o).add($handles).hide();\r
+\r
+                options.onSelectEnd(img, selection);\r
+\r
+                jQuery(document).unbind('mousemove', selectingMouseMove);\r
+                $areaOver.mousemove(areaMouseMove);\r
+            });\r
+        }\r
+        else if (options.movable) {\r
+            moveX = selection.x1 + left;\r
+            moveY = selection.y1 + top;\r
+            startX = evX(event);\r
+            startY = evY(event);\r
+\r
+            $areaOver.unbind('mousemove', areaMouseMove);\r
+\r
+            jQuery(document).mousemove(movingMouseMove)\r
+                .one('mouseup', function () {\r
+                    options.onSelectEnd(img, selection);\r
+\r
+                    jQuery(document).unbind('mousemove', movingMouseMove);\r
+                    $areaOver.mousemove(areaMouseMove);\r
+                });\r
+        }\r
+        else\r
+            $img.mousedown(event);\r
+\r
+        return false;\r
+    }\r
+\r
+    function aspectRatioXY()\r
+    {\r
+        x2 = Math.max(left, Math.min(left + imgWidth,\r
+            x1 + Math.abs(y2 - y1) * aspectRatio * (x2 >= x1 ? 1 : -1)));\r
+        y2 = Math.round(Math.max(top, Math.min(top + imgHeight,\r
+            y1 + Math.abs(x2 - x1) / aspectRatio * (y2 >= y1 ? 1 : -1))));\r
+        x2 = Math.round(x2);\r
+    }\r
+\r
+    function aspectRatioYX()\r
+    {\r
+        y2 = Math.max(top, Math.min(top + imgHeight,\r
+            y1 + Math.abs(x2 - x1) / aspectRatio * (y2 >= y1 ? 1 : -1)));\r
+        x2 = Math.round(Math.max(left, Math.min(left + imgWidth,\r
+            x1 + Math.abs(y2 - y1) * aspectRatio * (x2 >= x1 ? 1 : -1))));\r
+        y2 = Math.round(y2);\r
+    }\r
+\r
+    function doResize(newX2, newY2)\r
+    {\r
+        x2 = newX2;\r
+        y2 = newY2;\r
+\r
+        if (options.minWidth && Math.abs(x2 - x1) < options.minWidth) {\r
+            x2 = x1 - options.minWidth * (x2 < x1 ? 1 : -1);\r
+\r
+            if (x2 < left)\r
+                x1 = left + options.minWidth;\r
+            else if (x2 > left + imgWidth)\r
+                x1 = left + imgWidth - options.minWidth;\r
+        }\r
+\r
+        if (options.minHeight && Math.abs(y2 - y1) < options.minHeight) {\r
+            y2 = y1 - options.minHeight * (y2 < y1 ? 1 : -1);\r
+\r
+            if (y2 < top)\r
+                y1 = top + options.minHeight;\r
+            else if (y2 > top + imgHeight)\r
+                y1 = top + imgHeight - options.minHeight;\r
+        }\r
+\r
+        x2 = Math.max(left, Math.min(x2, left + imgWidth));\r
+        y2 = Math.max(top, Math.min(y2, top + imgHeight));\r
+\r
+        if (aspectRatio)\r
+            if (Math.abs(x2 - x1) / aspectRatio > Math.abs(y2 - y1))\r
+                aspectRatioYX();\r
+            else\r
+                aspectRatioXY();\r
+\r
+        if (options.maxWidth && Math.abs(x2 - x1) > options.maxWidth) {\r
+            x2 = x1 - options.maxWidth * (x2 < x1 ? 1 : -1);\r
+            if (aspectRatio) aspectRatioYX();\r
+        }\r
+\r
+        if (options.maxHeight && Math.abs(y2 - y1) > options.maxHeight) {\r
+            y2 = y1 - options.maxHeight * (y2 < y1 ? 1 : -1);\r
+            if (aspectRatio) aspectRatioXY();\r
+        }\r
+\r
+        selection = { x1: selX(Math.min(x1, x2)), x2: selX(Math.max(x1, x2)),\r
+            y1: selY(Math.min(y1, y2)), y2: selY(Math.max(y1, y2)),\r
+            width: Math.abs(x2 - x1), height: Math.abs(y2 - y1) };\r
+\r
+        update();\r
+\r
+        options.onSelectChange(img, selection);\r
+    }\r
+\r
+    function selectingMouseMove(event)\r
+    {\r
+        x2 = !resize.length || resize[H] || aspectRatio ? evX(event) : viewX(selection.x2);\r
+        y2 = !resize.length || resize[V] || aspectRatio ? evY(event) : viewY(selection.y2);\r
+\r
+        doResize(x2, y2);\r
+\r
+        return false;        \r
+    }\r
+\r
+    function doMove(newX1, newY1)\r
+    {\r
+        x2 = (x1 = newX1) + selection.width;\r
+        y2 = (y1 = newY1) + selection.height;\r
+\r
+        selection.x1 = selX(x1);\r
+        selection.y1 = selY(y1);\r
+        selection.x2 = selX(x2);\r
+        selection.y2 = selY(y2);\r
+\r
+        update();\r
+\r
+        options.onSelectChange(img, selection);\r
+    }\r
+\r
+    function movingMouseMove(event)\r
+    {\r
+        var newX1 = Math.max(left, Math.min(moveX + evX(event) - startX,\r
+            left + imgWidth - selection.width));\r
+        var newY1 = Math.max(top, Math.min(moveY + evY(event) - startY,\r
+            top + imgHeight - selection.height));\r
+\r
+        doMove(newX1, newY1);\r
+\r
+        event.preventDefault();     \r
+        return false;\r
+    }\r
+\r
+    function startSelection(event)\r
+    {\r
+        adjust();\r
+\r
+        selection = { x1: selX(x1), y1: selY(y1) };       \r
+        doResize(x1, y1);\r
+\r
+        resize = [ ];\r
+\r
+        $a.add($o).add($handles).show();\r
+\r
+        jQuery(document).unbind('mouseup', cancelSelection)\r
+            .mousemove(selectingMouseMove);\r
+        $areaOver.unbind('mousemove', areaMouseMove);\r
+\r
+        options.onSelectStart(img, selection);\r
+\r
+        jQuery(document).one('mouseup', function () {\r
+            if (options.autoHide || (selection.width * selection.height == 0))\r
+                $a.add($o).add($handles).hide();\r
+\r
+            options.onSelectEnd(img, selection);\r
+\r
+            jQuery(document).unbind('mousemove', selectingMouseMove);\r
+            $areaOver.mousemove(areaMouseMove);\r
+        });\r
+    }\r
+\r
+    function cancelSelection()\r
+    {\r
+        jQuery(document).unbind('mousemove', startSelection);\r
+        $a.add($o).add($handles).hide();\r
+\r
+        selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 };\r
+\r
+        options.onSelectChange(img, selection);\r
+        options.onSelectEnd(img, selection);\r
+    }\r
+\r
+    function imgMouseDown(event)\r
+    {\r
+        if (event.which != 1) return false;\r
+\r
+        startX = x1 = evX(event);\r
+        startY = y1 = evY(event);\r
+\r
+        jQuery(document).one('mousemove', startSelection)\r
+            .one('mouseup', cancelSelection);\r
+\r
+        return false;\r
+    }\r
+\r
+    function windowResize()\r
+    {\r
+        adjust();\r
+        update(false);\r
+        x1 = viewX(selection.x1);\r
+        y1 = viewY(selection.y1);\r
+        x2 = viewX(selection.x2);\r
+        y2 = viewY(selection.y2);\r
+    }\r
+\r
+    var docKeyPress = function(event) {\r
+        var k = options.keys, d = 10, t,\r
+            key = event.keyCode || event.which;\r
+\r
+        if (!isNaN(k.arrows)) d = k.arrows;\r
+        if (!isNaN(k.shift) && event.shiftKey) d = k.shift;\r
+        if (!isNaN(k.ctrl) && event.ctrlKey) d = k.ctrl;\r
+        if (!isNaN(k.alt) && (event.altKey || event.originalEvent.altKey)) d = k.alt;\r
+\r
+        if (k.arrows == 'resize' || (k.shift == 'resize' && event.shiftKey) ||\r
+            (k.ctrl == 'resize' && event.ctrlKey) ||\r
+            (k.alt == 'resize' && (event.altKey || event.originalEvent.altKey)))\r
+        {\r
+            switch (key) {\r
+            case 37:\r
+                d = -d;\r
+            case 39:\r
+                t = Math.max(x1, x2);\r
+                x1 = Math.min(x1, x2);\r
+                x2 = Math.max(t + d, x1);\r
+                if (aspectRatio) aspectRatioYX();\r
+                break;\r
+            case 38:\r
+                d = -d;\r
+            case 40:\r
+                t = Math.max(y1, y2);\r
+                y1 = Math.min(y1, y2);\r
+                y2 = Math.max(t + d, y1);\r
+                if (aspectRatio) aspectRatioXY();\r
+                break;\r
+            default:\r
+                return;\r
+            }\r
+\r
+            doResize(x2, y2);\r
+        }\r
+        else {\r
+            x1 = Math.min(x1, x2);\r
+            y1 = Math.min(y1, y2);\r
+\r
+            switch (key) {\r
+            case 37:\r
+                doMove(Math.max(x1 - d, left), y1);\r
+                break;\r
+            case 38:\r
+                doMove(x1, Math.max(y1 - d, top));\r
+                break;\r
+            case 39:\r
+                doMove(x1 + Math.min(d, imgWidth - selX(x2)), y1);\r
+                break;\r
+            case 40:\r
+                doMove(x1, y1 + Math.min(d, imgHeight - selY(y2)));\r
+                break;\r
+            default:\r
+                return;\r
+            }\r
+        }\r
+\r
+        return false;\r
+    };\r
+\r
+    this.setOptions = function(newOptions)\r
+    {\r
+        options = jQuery.extend(options, newOptions);\r
+\r
+        if (newOptions.x1 != null) {\r
+            selection = { x1: newOptions.x1, y1: newOptions.y1,\r
+                x2: newOptions.x2, y2: newOptions.y2 };\r
+            newOptions.show = true;\r
+        }\r
+\r
+        if (newOptions.keys)\r
+            options.keys = jQuery.extend({ shift: 1, ctrl: 'resize' },\r
+                newOptions.keys === true ? { } : newOptions.keys);\r
+\r
+        parent = jQuery(options.parent).get(0);\r
+\r
+        adjust();\r
+\r
+        getZIndex();\r
+\r
+        x1 = viewX(selection.x1);\r
+        y1 = viewY(selection.y1);\r
+        x2 = viewX(selection.x2);\r
+        y2 = viewY(selection.y2);\r
+        selection.width = x2 - x1;\r
+        selection.height = y2 - y1;\r
+\r
+        if ($handles) {\r
+            $handles.remove();\r
+            $handles = null;\r
+            handles = [ ];\r
+        }\r
+\r
+        if (options.handles) {\r
+            for (var i = 0; i < (options.handles == 'corners' ? 4 : 8); i++)\r
+                $handles = $handles ? $handles.add(handles[i] = jQuery('<div />')) :\r
+                    handles[i] = jQuery('<div />');\r
+\r
+            handleWidth = 4 + options.borderWidth;\r
+\r
+            $handles.css({ position: position, borderWidth: options.borderWidth,\r
+                borderStyle: 'solid', borderColor: options.borderColor1, \r
+                backgroundColor: options.borderColor2, display: $area.css('display'),\r
+                width: handleWidth + 'px', height: handleWidth + 'px',\r
+                fontSize: '0px', zIndex: zIndex > 0 ? zIndex + 1 : '1' });\r
+            $handles.addClass(options.classPrefix + '-handle');\r
+\r
+            handleWidth += options.borderWidth * 2;\r
+        }\r
+\r
+        $o.addClass(options.classPrefix + '-outer');\r
+        $area.addClass(options.classPrefix + '-selection');\r
+        $border1.addClass(options.classPrefix + '-border1');\r
+        $border2.addClass(options.classPrefix + '-border2');\r
+\r
+        $a.css({ borderWidth: options.borderWidth + 'px' });\r
+        $area.css({ backgroundColor: options.selectionColor, opacity: options.selectionOpacity });       \r
+        $border1.css({ borderStyle: 'solid', borderColor: options.borderColor1 });\r
+        $border2.css({ borderStyle: 'dashed', borderColor: options.borderColor2 });\r
+        $o.css({ opacity: options.outerOpacity, backgroundColor: options.outerColor });\r
+\r
+        jQuery(options.parent).append($o.add($a).add($handles));\r
+\r
+        update();\r
+\r
+        if (newOptions.hide)\r
+            $a.add($o).add($handles).hide();\r
+        else if (newOptions.show)\r
+            $a.add($o).add($handles).show();\r
+\r
+        aspectRatio = options.aspectRatio && (d = options.aspectRatio.split(/:/)) ?\r
+            d[0] / d[1] : null;\r
+\r
+        if (aspectRatio)\r
+            if (options.minWidth)\r
+                options.minHeight = parseInt(options.minWidth / aspectRatio);\r
+            else if (options.minHeight)\r
+                options.minWidth = parseInt(options.minHeight * aspectRatio);\r
+\r
+        if (options.disable || options.enable === false) {\r
+            $areaOver.unbind('mousemove', areaMouseMove).unbind('mousedown', areaMouseDown);\r
+            $img.add($o).unbind('mousedown', imgMouseDown);\r
+            jQuery(window).unbind('resize', windowResize);\r
+        }\r
+        else if (options.enable || options.disable === false) {\r
+            if (options.resizable || options.movable)\r
+                $areaOver.mousemove(areaMouseMove).mousedown(areaMouseDown);\r
+\r
+            if (!options.persistent)\r
+                $img.add($o).mousedown(imgMouseDown);\r
+            jQuery(window).resize(windowResize);\r
+        }\r
+\r
+        options.enable = options.disable = undefined;\r
+    };\r
+\r
+    if (jQuery.browser.msie)   \r
+        $img.attr('unselectable', 'on');\r
+\r
+    jQuery.imgAreaSelect.keyPress = jQuery.browser.msie ||\r
+        jQuery.browser.safari ? 'keydown' : 'keypress';\r
+\r
+    if (jQuery.browser.opera)\r
+        $areaOver.append($areaOver2 = jQuery('<div style="width: 100%; height: 100%;" />'));\r
+\r
+    getZIndex();\r
+\r
+    $a.add($o).css({ display: 'none', position: position,\r
+        overflow: 'hidden', zIndex: zIndex > 0 ? zIndex : '0' });\r
+    $areaOver.css({ zIndex: zIndex > 0 ? zIndex + 2 : '2' });\r
+    $area.css({ borderStyle: 'solid' });\r
+\r
+    this.setOptions(options = jQuery.extend({\r
+        borderColor1: '#000',\r
+        borderColor2: '#fff',\r
+        borderWidth: 1,\r
+        classPrefix: 'imgareaselect',\r
+        movable: true,\r
+        resizable: true,\r
+        selectionColor: '#fff',\r
+        selectionOpacity: 0.2,\r
+        outerColor: '#000',\r
+        outerOpacity: 0.2,\r
+        parent: 'body',\r
+        onSelectStart: function () {},\r
+        onSelectChange: function () {},\r
+        onSelectEnd: function () {}\r
+    }, options));\r
+};\r
+\r
+jQuery.fn.imgAreaSelect = function (options) {\r
+    options = options || {};\r
+\r
+    this.each(function () {\r
+        if (jQuery(this).data('imgAreaSelect'))\r
+            jQuery(this).data('imgAreaSelect').setOptions(options);\r
+        else {\r
+            if (options.enable === undefined && options.disable === undefined)\r
+                options.enable = true;\r
+\r
+            jQuery(this).data('imgAreaSelect', new jQuery.imgAreaSelect.init(this, options));\r
+        }\r
+    });\r
+\r
+    return this;\r
+};\r
diff --git a/vendors/jquery.imgareaselect-0.8.js b/vendors/jquery.imgareaselect-0.8.js
deleted file mode 100644 (file)
index 123bbf7..0000000
+++ /dev/null
@@ -1,639 +0,0 @@
-/*
- * imgAreaSelect jQuery plugin
- * version 0.8
- *
- * Copyright (c) 2008-2009 Michal Wojciechowski (odyniec.net)
- *
- * Dual licensed under the MIT (MIT-LICENSE.txt) 
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://odyniec.net/projects/imgareaselect/
- *
- */
-
-(function($) {
-
-$.imgAreaSelect = { onKeyPress: null };
-
-$.imgAreaSelect.init = function (img, options) {
-    var $img = $(img), imgLoaded, $box = $('<div />'), $area = $('<div />'),
-        $border1 = $('<div />'), $border2 = $('<div />'), $areaOpera,
-        $outLeft = $('<div />'), $outTop = $('<div />'),
-        $outRight = $('<div />'), $outBottom = $('<div />'),
-        $handles = $([]), handleWidth, handles = [ ], left, top, M = Math,
-        imgOfs, imgWidth, imgHeight, $parent, parOfs,
-        zIndex = 0, position = 'absolute', $p, startX, startY,
-        scaleX = 1, scaleY = 1, resizeMargin = 10, resize = [ ], V = 0, H = 1,
-        d, aspectRatio, x1, x2, y1, y2, x, y, adjusted, shown, i,
-        selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 };
-
-    var $o = $outLeft.add($outTop).add($outRight).add($outBottom);
-
-    function viewX(x)
-    {
-        return x + imgOfs.left - parOfs.left;
-    }
-
-    function viewY(y)
-    {
-        return y + imgOfs.top - parOfs.top;
-    }
-
-    function selX(x)
-    {
-        return x - imgOfs.left + parOfs.left;
-    }
-
-    function selY(y)
-    {
-        return y - imgOfs.top + parOfs.top;
-    }
-
-    function evX(event)
-    {
-        return event.pageX - parOfs.left;
-    }
-
-    function evY(event)
-    {
-        return event.pageY - parOfs.top;
-    }
-
-    function trueSelection()
-    {
-        return { x1: M.round(selection.x1 * scaleX),
-            y1: M.round(selection.y1 * scaleY),
-            x2: M.round(selection.x2 * scaleX),
-            y2: M.round(selection.y2 * scaleY),
-            width: M.round(selection.x2 * scaleX) - M.round(selection.x1 * scaleX),
-            height: M.round(selection.y2 * scaleY) - M.round(selection.y1 * scaleY) };
-    }
-
-    function getZIndex()
-    {
-        $p = $img;
-
-        while ($p.length && !$p.is('body')) {
-            if (!isNaN($p.css('z-index')) && $p.css('z-index') > zIndex)
-                zIndex = $p.css('z-index');
-            if ($p.css('position') == 'fixed')
-                position = 'fixed';
-
-            $p = $p.parent();
-        }
-
-        if (!isNaN(options.zIndex))
-            zIndex = options.zIndex;
-    }
-
-    function adjust()
-    {
-        imgOfs = { left: M.round($img.offset().left), top: M.round($img.offset().top) };
-        // next two lines are Tidypics change to handle image having padding and border
-        imgOfs.left = parseInt(imgOfs.left) + parseInt($img.css("border-left-width")) + parseInt($img.css("padding-left"));
-        imgOfs.top = parseInt(imgOfs.top) + parseInt($img.css("border-top-width")) + parseInt($img.css("padding-top"));
-        
-        imgWidth = $img.width();
-        imgHeight = $img.height();
-
-        if ($().jquery == '1.3.2' && $.browser.safari && position == 'fixed') {
-            imgOfs.top += M.max(document.documentElement.scrollTop, $('body').scrollTop()); 
-            imgOfs.left += M.max(document.documentElement.scrollLeft, $('body').scrollLeft());
-        }
-
-        parOfs = $.inArray($parent.css('position'), ['absolute', 'relative']) != -1 ? 
-            { left: M.round($parent.offset().left) - $parent.scrollLeft(),
-                top: M.round($parent.offset().top) - $parent.scrollTop() } :
-            position == 'fixed' ?
-                { left: $(document).scrollLeft(), top: $(document).scrollTop() } :
-                { left: 0, top: 0 };
-
-        left = viewX(0);
-        top = viewY(0);
-    }
-
-    function update(resetKeyPress)
-    {
-        if (!shown) return;
-
-        $box.css({
-            left: viewX(selection.x1) + 'px', top: viewY(selection.y1) + 'px',
-            width: selection.width + 'px', height: selection.height + 'px'
-        });
-        $area.add($border1).add($border2).css({
-            left: '0px', top: '0px',
-            width: M.max(selection.width - options.borderWidth * 2, 0) + 'px',
-            height: M.max(selection.height - options.borderWidth * 2, 0) + 'px'
-        });
-        $border1.css({ borderStyle: 'solid', borderColor: options.borderColor1 });
-        $border2.css({ borderStyle: 'dashed', borderColor: options.borderColor2 });
-        $border1.add($border2).css({ opacity: options.borderOpacity });
-        $outLeft.css({ left: left + 'px', top: top + 'px',
-            width: selection.x1 + 'px', height: imgHeight + 'px' });
-        $outTop.css({ left: left + selection.x1 + 'px', top: top + 'px',
-            width: selection.width + 'px', height: selection.y1 + 'px' });
-        $outRight.css({ left: left + selection.x2 + 'px', top: top + 'px',
-            width: imgWidth - selection.x2 + 'px', height: imgHeight + 'px' });
-        $outBottom.css({ left: left + selection.x1 + 'px', top: top + selection.y2 + 'px',
-            width: selection.width + 'px', height: imgHeight - selection.y2 + 'px' });
-
-        if (handles.length) {
-            handles[1].css({ left: selection.width - handleWidth + 'px' });
-            handles[2].css({ left: selection.width - handleWidth + 'px',
-                top: selection.height - handleWidth + 'px' });
-            handles[3].css({ top: selection.height - handleWidth + 'px' });
-
-            if (handles.length == 8) {
-                handles[4].css({ left: (selection.width - handleWidth) / 2 + 'px' });
-                handles[5].css({ left: selection.width - handleWidth + 'px',
-                    top: (selection.height - handleWidth) / 2 + 'px' });
-                handles[6].css({ left: (selection.width - handleWidth) / 2 + 'px',
-                    top: selection.height - handleWidth + 'px' });
-                handles[7].css({ top: (selection.height - handleWidth) / 2 + 'px' });
-            }
-        }
-
-        if (resetKeyPress !== false) {
-            if ($.imgAreaSelect.keyPress != docKeyPress)
-                $(document).unbind($.imgAreaSelect.keyPress,
-                    $.imgAreaSelect.onKeyPress);
-
-            if (options.keys)
-                $(document).bind($.imgAreaSelect.keyPress,
-                    $.imgAreaSelect.onKeyPress = docKeyPress);
-        }
-
-        if ($.browser.msie && options.borderWidth == 1 && options.borderOpacity < 1) {
-            $border1.add($border2).css('margin', '0');
-            setTimeout(function () { $border1.add($border2).css('margin', 'auto'); }, 0);
-        }
-    }
-
-    function areaMouseMove(event)
-    {
-        if (!adjusted) {
-            adjust();
-            adjusted = true;
-
-            $box.one('mouseout', function () { adjusted = false; });
-        }
-
-        x = selX(evX(event)) - selection.x1;
-        y = selY(evY(event)) - selection.y1;
-
-        resize = [ ];
-
-        if (options.resizable) {
-            if (y <= resizeMargin)
-                resize[V] = 'n';
-            else if (y >= selection.height - resizeMargin)
-                resize[V] = 's';
-            if (x <= resizeMargin)
-                resize[H] = 'w';
-            else if (x >= selection.width - resizeMargin)
-                resize[H] = 'e';
-        }
-
-        $box.css('cursor', resize.length ? resize.join('') + '-resize' :
-            options.movable ? 'move' : '');
-        if ($areaOpera)
-            $areaOpera.toggle();
-    }
-
-    function docMouseUp(event)
-    {
-        resize = [ ];
-
-        $('body').css('cursor', '');
-
-        if (options.autoHide || selection.width * selection.height == 0)
-            $box.add($o).hide();
-
-        options.onSelectEnd(img, trueSelection());
-
-        $(document).unbind('mousemove', selectingMouseMove);
-        $box.mousemove(areaMouseMove);
-    }
-
-    function areaMouseDown(event)
-    {
-        if (event.which != 1) return false;
-
-        adjust();
-
-        if (options.resizable && resize.length > 0) {
-            $('body').css('cursor', resize.join('') + '-resize');
-
-            x1 = viewX(selection[resize[H] == 'w' ? 'x2' : 'x1']);
-            y1 = viewY(selection[resize[V] == 'n' ? 'y2' : 'y1']);
-
-            $(document).mousemove(selectingMouseMove)
-                .one('mouseup', docMouseUp);
-            $box.unbind('mousemove', areaMouseMove);
-        }
-        else if (options.movable) {
-            startX = left + selection.x1 - evX(event);
-            startY = top + selection.y1 - evY(event);
-
-            $box.unbind('mousemove', areaMouseMove);
-
-            $(document).mousemove(movingMouseMove)
-                .one('mouseup', function () {
-                    options.onSelectEnd(img, trueSelection());
-
-                    $(document).unbind('mousemove', movingMouseMove);
-                    $box.mousemove(areaMouseMove);
-                });
-        }
-        else
-            $img.mousedown(event);
-
-        return false;
-    }
-
-    function aspectRatioXY()
-    {
-        x2 = M.max(left, M.min(left + imgWidth,
-            x1 + M.abs(y2 - y1) * aspectRatio * (x2 < x1 ? -1 : 1)));
-        y2 = M.round(M.max(top, M.min(top + imgHeight,
-            y1 + M.abs(x2 - x1) / aspectRatio * (y2 < y1 ? -1 : 1))));
-        x2 = M.round(x2);
-    }
-
-    function aspectRatioYX()
-    {
-        y2 = M.max(top, M.min(top + imgHeight,
-            y1 + M.abs(x2 - x1) / aspectRatio * (y2 < y1 ? -1 : 1)));
-        x2 = M.round(M.max(left, M.min(left + imgWidth,
-            x1 + M.abs(y2 - y1) * aspectRatio * (x2 < x1 ? -1 : 1))));
-        y2 = M.round(y2);
-    }
-
-    function doResize()
-    {
-        if (options.minWidth && M.abs(x2 - x1) < options.minWidth) {
-            x2 = x1 - options.minWidth * (x2 < x1 ? 1 : -1);
-
-            if (x2 < left)
-                x1 = left + options.minWidth;
-            else if (x2 > left + imgWidth)
-                x1 = left + imgWidth - options.minWidth;
-        }
-
-        if (options.minHeight && M.abs(y2 - y1) < options.minHeight) {
-            y2 = y1 - options.minHeight * (y2 < y1 ? 1 : -1);
-
-            if (y2 < top)
-                y1 = top + options.minHeight;
-            else if (y2 > top + imgHeight)
-                y1 = top + imgHeight - options.minHeight;
-        }
-
-        x2 = M.max(left, M.min(x2, left + imgWidth));
-        y2 = M.max(top, M.min(y2, top + imgHeight));
-
-        if (aspectRatio)
-            if (M.abs(x2 - x1) / aspectRatio > M.abs(y2 - y1))
-                aspectRatioYX();
-            else
-                aspectRatioXY();
-
-        if (options.maxWidth && M.abs(x2 - x1) > options.maxWidth) {
-            x2 = x1 - options.maxWidth * (x2 < x1 ? 1 : -1);
-            if (aspectRatio) aspectRatioYX();
-        }
-
-        if (options.maxHeight && M.abs(y2 - y1) > options.maxHeight) {
-            y2 = y1 - options.maxHeight * (y2 < y1 ? 1 : -1);
-            if (aspectRatio) aspectRatioXY();
-        }
-
-        selection = { x1: selX(M.min(x1, x2)), x2: selX(M.max(x1, x2)),
-            y1: selY(M.min(y1, y2)), y2: selY(M.max(y1, y2)),
-            width: M.abs(x2 - x1), height: M.abs(y2 - y1) };
-
-        update();
-
-        options.onSelectChange(img, trueSelection());
-    }
-
-    function selectingMouseMove(event)
-    {
-        x2 = !resize.length || resize[H] || aspectRatio ? evX(event) : viewX(selection.x2);
-        y2 = !resize.length || resize[V] || aspectRatio ? evY(event) : viewY(selection.y2);
-
-        doResize();
-
-        return false;        
-    }
-
-    function doMove(newX1, newY1)
-    {
-        x2 = (x1 = newX1) + selection.width;
-        y2 = (y1 = newY1) + selection.height;
-
-        selection = $.extend(selection, { x1: selX(x1), y1: selY(y1),
-            x2: selX(x2), y2: selY(y2) });
-
-        update();
-
-        options.onSelectChange(img, trueSelection());
-    }
-
-    function movingMouseMove(event)
-    {
-        x1 = M.max(left, M.min(startX + evX(event), left + imgWidth - selection.width));
-        y1 = M.max(top, M.min(startY + evY(event), top + imgHeight - selection.height));
-
-        doMove(x1, y1);
-
-        event.preventDefault();     
-        return false;
-    }
-
-    function startSelection(event)
-    {
-        adjust();
-
-        x2 = x1;
-        y2 = y1;       
-        doResize();
-
-        resize = [ ];
-
-        $box.add($o.is(':visible') ? null : $o).show();
-        shown = true;
-
-        $(document).unbind('mouseup', cancelSelection)
-            .mousemove(selectingMouseMove).one('mouseup', docMouseUp);
-        $box.unbind('mousemove', areaMouseMove);
-
-        options.onSelectStart(img, trueSelection());
-    }
-
-    function cancelSelection()
-    {
-        $(document).unbind('mousemove', startSelection);
-        $box.add($o).hide();
-
-        selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 };
-
-        options.onSelectChange(img, selection);
-        options.onSelectEnd(img, selection);
-    }
-
-    function imgMouseDown(event)
-    {
-        if (event.which != 1) return false;
-
-        adjust();
-        startX = x1 = evX(event);
-        startY = y1 = evY(event);
-
-        $(document).one('mousemove', startSelection)
-            .one('mouseup', cancelSelection);
-
-        return false;
-    }
-
-    function parentScroll()
-    {
-        adjust();
-        update(false);
-        x1 = viewX(selection.x1); y1 = viewY(selection.y1);
-        x2 = viewX(selection.x2); y2 = viewY(selection.y2);
-    }
-
-    function imgLoad()
-    {
-        imgLoaded = true;
-
-        if (options.show) {
-            shown = true;
-            adjust();
-            update();
-            $box.add($o).show();
-        }
-
-        $box.add($o).css({ visibility: '' });
-    }
-
-    var docKeyPress = function(event) {
-        var k = options.keys, d, t, key = event.keyCode || event.which;
-
-        d = !isNaN(k.alt) && (event.altKey || event.originalEvent.altKey) ? k.alt :
-            !isNaN(k.ctrl) && event.ctrlKey ? k.ctrl :
-            !isNaN(k.shift) && event.shiftKey ? k.shift :
-            !isNaN(k.arrows) ? k.arrows : 10;
-
-        if (k.arrows == 'resize' || (k.shift == 'resize' && event.shiftKey) ||
-            (k.ctrl == 'resize' && event.ctrlKey) ||
-            (k.alt == 'resize' && (event.altKey || event.originalEvent.altKey)))
-        {
-            switch (key) {
-            case 37:
-                d = -d;
-            case 39:
-                t = M.max(x1, x2);
-                x1 = M.min(x1, x2);
-                x2 = M.max(t + d, x1);
-                if (aspectRatio) aspectRatioYX();
-                break;
-            case 38:
-                d = -d;
-            case 40:
-                t = M.max(y1, y2);
-                y1 = M.min(y1, y2);
-                y2 = M.max(t + d, y1);
-                if (aspectRatio) aspectRatioXY();
-                break;
-            default:
-                return;
-            }
-
-            doResize();
-        }
-        else {
-            x1 = M.min(x1, x2);
-            y1 = M.min(y1, y2);
-
-            switch (key) {
-            case 37:
-                doMove(M.max(x1 - d, left), y1);
-                break;
-            case 38:
-                doMove(x1, M.max(y1 - d, top));
-                break;
-            case 39:
-                doMove(x1 + M.min(d, imgWidth - selX(x2)), y1);
-                break;
-            case 40:
-                doMove(x1, y1 + M.min(d, imgHeight - selY(y2)));
-                break;
-            default:
-                return;
-            }
-        }
-
-        return false;
-    };
-
-    this.setOptions = function(newOptions)
-    {
-        if (newOptions.parent)
-            ($parent = $(newOptions.parent)).append($box.add($o));
-
-        adjust();
-        getZIndex();
-
-        if (newOptions.x1 != null) {
-            selection = { x1: newOptions.x1, y1: newOptions.y1,
-                x2: newOptions.x2, y2: newOptions.y2 };
-            newOptions.show = !newOptions.hide;
-
-            x1 = viewX(selection.x1); y1 = viewY(selection.y1);
-            x2 = viewX(selection.x2); y2 = viewY(selection.y2);
-            selection.width = x2 - x1;
-            selection.height = y2 - y1;
-        }
-
-        if (newOptions.handles != null) {
-            $handles.remove();
-            $handles = $(handles = [ ]);
-
-            i = newOptions.handles ? newOptions.handles == 'corners' ? 4 : 8 : 0;
-
-            while (i--)
-                $handles = $handles.add(handles[i] = $('<div />'));
-
-            handleWidth = 4 + options.borderWidth;
-
-            $handles.css({ position: 'absolute', borderWidth: options.borderWidth + 'px',
-                borderStyle: 'solid', borderColor: options.borderColor1, 
-                opacity: options.borderOpacity, backgroundColor: options.borderColor2,
-                width: handleWidth + 'px', height: handleWidth + 'px',
-                fontSize: '0px', zIndex: zIndex > 0 ? zIndex + 1 : '1' })
-                .addClass(options.classPrefix + '-handle');
-
-            handleWidth += options.borderWidth * 2;
-        }
-
-        update();
-
-        options = $.extend(options, newOptions);
-
-        if (options.imageWidth || options.imageHeight) {
-            scaleX = (parseInt(options.imageWidth) || imgWidth) / imgWidth;
-            scaleY = (parseInt(options.imageHeight) || imgHeight) / imgHeight;
-        }
-
-        if (newOptions.keys)
-            options.keys = $.extend({ shift: 1, ctrl: 'resize' },
-                newOptions.keys === true ? { } : newOptions.keys);
-
-        $o.addClass(options.classPrefix + '-outer');
-        $area.addClass(options.classPrefix + '-selection');
-        $border1.addClass(options.classPrefix + '-border1');
-        $border2.addClass(options.classPrefix + '-border2');
-
-        $box.add($area).add($border1).add($border2).css({ borderWidth: options.borderWidth + 'px' });
-        $area.css({ backgroundColor: options.selectionColor, opacity: options.selectionOpacity });       
-        $border1.css({ borderStyle: 'solid', borderColor: options.borderColor1 });
-        $border2.css({ borderStyle: 'dashed', borderColor: options.borderColor2 });
-        $border1.add($border2).css({ opacity: options.borderOpacity });
-        $o.css({ opacity: options.outerOpacity, backgroundColor: options.outerColor });
-
-        $box.append($area.add($border1).add($border2).add($handles).add($areaOpera));
-
-        if (newOptions.hide)
-            $box.add($o).hide();
-        else if (newOptions.show && imgLoaded) {
-            shown = true;
-            update();
-            $box.add($o).show();
-        }
-
-        aspectRatio = options.aspectRatio && (d = options.aspectRatio.split(/:/)) ?
-            d[0] / d[1] : null;
-
-        if (aspectRatio)
-            if (options.minWidth)
-                options.minHeight = parseInt(options.minWidth / aspectRatio);
-            else if (options.minHeight)
-                options.minWidth = parseInt(options.minHeight * aspectRatio);
-
-        if (options.disable || options.enable === false) {
-            $box.unbind('mousemove', areaMouseMove).unbind('mousedown', areaMouseDown);
-            $img.add($o).unbind('mousedown', imgMouseDown);
-            $(window).unbind('resize', parentScroll);
-            $img.add($img.parents()).unbind('scroll', parentScroll);
-        }
-        else if (options.enable || options.disable === false) {
-            if (options.resizable || options.movable)
-                $box.mousemove(areaMouseMove).mousedown(areaMouseDown);
-
-            if (!options.persistent)
-                $img.add($o).mousedown(imgMouseDown);
-            $(window).resize(parentScroll);
-            $img.add($img.parents()).scroll(parentScroll);
-        }
-
-        options.enable = options.disable = undefined;
-    };
-
-    if ($.browser.msie)
-        $img.attr('unselectable', 'on');
-
-    $.imgAreaSelect.keyPress = $.browser.msie ||
-        $.browser.safari ? 'keydown' : 'keypress';
-
-    if ($.browser.opera)
-        ($areaOpera = $('<div style="width: 100%; height: 100%; position: absolute;" />'))
-            .css({ zIndex: zIndex > 0 ? zIndex + 2 : '2' });
-
-    this.setOptions(options = $.extend({
-        borderColor1: '#000',
-        borderColor2: '#fff',
-        borderWidth: 1,
-        borderOpacity: .5,
-        classPrefix: 'imgareaselect',
-        movable: true,
-        resizable: true,
-        selectionColor: '#fff',
-        selectionOpacity: 0,
-        outerColor: '#000',
-        outerOpacity: .4,
-        parent: 'body',
-        onSelectStart: function () {},
-        onSelectChange: function () {},
-        onSelectEnd: function () {}
-    }, options));
-
-    $box.add($o).css({ visibility: 'hidden', position: position,
-        overflow: 'hidden', zIndex: zIndex > 0 ? zIndex : '0' });
-    $area.css({ borderStyle: 'solid' });
-    $box.css({ position: position, zIndex: zIndex > 0 ? zIndex + 2 : '2' });
-    $area.add($border1).add($border2).css({ position: 'absolute' });
-
-    img.complete || img.readyState == 'complete' || !$img.is('img') ?
-        imgLoad() : $img.one('load', imgLoad);
-};
-
-$.fn.imgAreaSelect = function (options) {
-    options = options || {};
-
-    this.each(function () {
-        if ($(this).data('imgAreaSelect'))
-            $(this).data('imgAreaSelect').setOptions(options);
-        else {
-            if (options.enable === undefined && options.disable === undefined)
-                options.enable = true;
-
-            $(this).data('imgAreaSelect', new $.imgAreaSelect.init(this, options));
-        }
-    });
-
-    return this;
-};
-
-})(jQuery);
index d47d88a37dc50b362b5d1c682a12b895f031f36b..beebd3edf20af3f2099f0b2c5fff03afb0be5edd 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
        $photo_tags_json = $vars['photo_tags_json'];\r
 ?>\r
-<script type="text/javascript" src="<?= $vars['url'] ?>mod/tidypics/vendors/jquery.imgareaselect-0.8.js"></script>\r
+<script type="text/javascript" src="<?= $vars['url'] ?>mod/tidypics/vendors/jquery.imgareaselect-0.7.js"></script>\r
 <script type="text/javascript" src="<?= $vars['url'] ?>mod/tidypics/vendors/jquery.quicksearch.js"></script>\r
  \r
 <script type="text/javascript">\r