]> git.mxchange.org Git - friendica.git/commitdiff
update javascript cropper library
authorrabuzarus <rabuzarus@t-online.de>
Thu, 29 Mar 2018 15:57:06 +0000 (17:57 +0200)
committerrabuzarus <rabuzarus@t-online.de>
Thu, 29 Mar 2018 15:57:06 +0000 (17:57 +0200)
38 files changed:
composer.json
composer.lock
view/global.css
view/js/cropper/cropper.css [deleted file]
view/js/cropper/cropper.html [deleted file]
view/js/cropper/cropper.js [deleted file]
view/js/cropper/cropper.uncompressed.js [deleted file]
view/js/cropper/lib/builder.js [deleted file]
view/js/cropper/lib/controls.js [deleted file]
view/js/cropper/lib/dragdrop.js [deleted file]
view/js/cropper/lib/effects.js [deleted file]
view/js/cropper/lib/prototype.js [deleted file]
view/js/cropper/lib/scriptaculous.js [deleted file]
view/js/cropper/lib/slider.js [deleted file]
view/js/cropper/lib/unittest.js [deleted file]
view/js/cropper/licence.txt [deleted file]
view/js/cropper/marqueeHoriz.gif [deleted file]
view/js/cropper/marqueeVert.gif [deleted file]
view/js/cropper/tests/castle.jpg [deleted file]
view/js/cropper/tests/castleMed.jpg [deleted file]
view/js/cropper/tests/example-Basic.htm [deleted file]
view/js/cropper/tests/example-CSS-Absolute.htm [deleted file]
view/js/cropper/tests/example-CSS-Float.htm [deleted file]
view/js/cropper/tests/example-CSS-Relative.htm [deleted file]
view/js/cropper/tests/example-CoordsOnLoad.htm [deleted file]
view/js/cropper/tests/example-CoordsOnLoadWithRatio.htm [deleted file]
view/js/cropper/tests/example-Dimensions.htm [deleted file]
view/js/cropper/tests/example-DynamicImage.htm [deleted file]
view/js/cropper/tests/example-FixedRatio.htm [deleted file]
view/js/cropper/tests/example-MinimumDimensions.htm [deleted file]
view/js/cropper/tests/example-MinimumWidth.htm [deleted file]
view/js/cropper/tests/example-Preview.htm [deleted file]
view/js/cropper/tests/poppy.jpg [deleted file]
view/js/cropper/tests/staticHTMLStructure.htm [deleted file]
view/templates/cropbody.tpl
view/templates/crophead.tpl
view/theme/duepuntozero/style.css
view/theme/frio/css/style.css

index 81f0b99737d4326750f927279c10bb2cab8045ad..9cef6f379b44241c4830be784247dbba7e462adc 100644 (file)
                "npm-asset/jquery-colorbox": "^1.6",
                "npm-asset/jquery-datetimepicker": "^2.4.0",
                "npm-asset/jgrowl": "^1.4",
-               "npm-asset/fullcalendar": "^3.0.1"
+               "npm-asset/fullcalendar": "^3.0.1",
+               "fengyuanchen/cropperjs": "1.2.2"
        },
        "repositories": [
-        {
-            "type": "vcs",
-            "url": "https://github.com/pear/Text_Highlighter"
-        }
-    ],
+               {
+                       "type": "vcs",
+                       "url": "https://github.com/pear/Text_Highlighter"
+               },
+               {
+                       "type": "package",
+                       "package": {
+                               "name": "fengyuanchen/cropperjs",
+                               "version": "1.2.2",
+                               "dist": {
+                                       "url": "https://github.com/fengyuanchen/cropperjs/archive/v1.2.2.zip",
+                                       "type": "zip"
+                               }
+                       }
+               }
+       ],
        "autoload": {
                "psr-4": {
                        "Friendica\\": "src/"
                "optimize-autoloader": true,
                "preferred-install": "dist",
                "fxp-asset": {
-            "installer-paths": {
-                "npm-asset-library": "view/asset",
-                "bower-asset-library": "view/asset"
-            }
-        }
+                       "installer-paths": {
+                               "npm-asset-library": "view/asset",
+                               "bower-asset-library": "view/asset"
+                       }
+               }
        },
        "archive": {
                "exclude": [
index 20b89bfbef949bfc49cba4de245c564166481fc5..5d15aef12a28ac0f14c074f9a7852baf88362151 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "0811acc361f70e08cce3ec09940cbf2d",
+    "content-hash": "c665c4d63bd0317db0c1992ad7c6c7a1",
     "packages": [
         {
             "name": "asika/simple-console",
         },
         {
             "name": "bower-asset/Chart-js",
-            "version": "v2.7.1",
+            "version": "v2.7.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/chartjs/Chart.js.git",
-                "reference": "0fead21939b92c15093c1b7d5ee2627fb5900fff"
+                "reference": "98f104cdd03617f1300b417b3d60c23d4e3e3403"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/chartjs/Chart.js/zipball/0fead21939b92c15093c1b7d5ee2627fb5900fff",
-                "reference": "0fead21939b92c15093c1b7d5ee2627fb5900fff",
+                "url": "https://api.github.com/repos/chartjs/Chart.js/zipball/98f104cdd03617f1300b417b3d60c23d4e3e3403",
+                "reference": "98f104cdd03617f1300b417b3d60c23d4e3e3403",
                 "shasum": ""
             },
             "type": "bower-asset-library",
@@ -69,7 +69,7 @@
                 "MIT"
             ],
             "description": "Simple HTML5 charts using the canvas element.",
-            "time": "2017-10-28T15:01:52+00:00"
+            "time": "2018-03-01T21:45:21+00:00"
         },
         {
             "name": "bower-asset/base64",
             ],
             "time": "2015-08-05T01:03:42+00:00"
         },
+        {
+            "name": "fengyuanchen/cropperjs",
+            "version": "1.2.2",
+            "dist": {
+                "type": "zip",
+                "url": "https://github.com/fengyuanchen/cropperjs/archive/v1.2.2.zip",
+                "reference": null,
+                "shasum": null
+            },
+            "type": "library"
+        },
         {
             "name": "fxp/composer-asset-plugin",
             "version": "v1.4.2",
         },
         {
             "name": "guzzlehttp/guzzle",
-            "version": "6.3.0",
+            "version": "6.3.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/guzzle.git",
-                "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699"
+                "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
-                "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/68d0ea14d5a3f42a20e87632a5f84931e2709c90",
+                "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90",
                 "shasum": ""
             },
             "require": {
             },
             "require-dev": {
                 "ext-curl": "*",
-                "phpunit/phpunit": "^4.0 || ^5.0",
+                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4",
                 "psr/log": "^1.0"
             },
             "suggest": {
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "6.2-dev"
+                    "dev-master": "6.3-dev"
                 }
             },
             "autoload": {
                 "rest",
                 "web service"
             ],
-            "time": "2017-06-22T18:50:49+00:00"
+            "time": "2018-03-26T16:33:04+00:00"
         },
         {
             "name": "guzzlehttp/promises",
         },
         {
             "name": "mobiledetect/mobiledetectlib",
-            "version": "2.8.30",
+            "version": "2.8.31",
             "source": {
                 "type": "git",
                 "url": "https://github.com/serbanghita/Mobile-Detect.git",
-                "reference": "5500bbbf312fe77ef0c7223858dad84fe49ee0c3"
+                "reference": "adb882ea3b9d154f087ecb2c333180dad6f4dd37"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/5500bbbf312fe77ef0c7223858dad84fe49ee0c3",
-                "reference": "5500bbbf312fe77ef0c7223858dad84fe49ee0c3",
+                "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/adb882ea3b9d154f087ecb2c333180dad6f4dd37",
+                "reference": "adb882ea3b9d154f087ecb2c333180dad6f4dd37",
                 "shasum": ""
             },
             "require": {
                 "mobile detector",
                 "php mobile detect"
             ],
-            "time": "2017-12-18T10:38:51+00:00"
+            "time": "2018-02-26T19:39:55+00:00"
         },
         {
             "name": "npm-asset/fullcalendar",
-            "version": "3.8.2",
+            "version": "3.9.0",
             "dist": {
                 "type": "tar",
-                "url": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-3.8.2.tgz",
+                "url": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-3.9.0.tgz",
                 "reference": null,
-                "shasum": "ef7dc77b89134bbe6163e51136f7a1f8bfc1d807"
+                "shasum": "b608a9989f3416f0b1d526c6bdfeeaf2ac79eda5"
             },
             "require": {
                 "npm-asset/jquery": ">=2,<4.0",
-                "npm-asset/moment": ">=2.9.0,<3.0.0"
+                "npm-asset/moment": ">=2.20.1,<3.0.0"
             },
             "require-dev": {
-                "npm-asset/awesome-typescript-loader": ">=3.3.0,<4.0.0",
+                "npm-asset/awesome-typescript-loader": ">=3.5.0,<4.0.0",
                 "npm-asset/bootstrap": ">=3.3.7,<4.0.0",
                 "npm-asset/components-jqueryui": "dev-github:components/jqueryui",
-                "npm-asset/css-loader": ">=0.28.7,<0.29.0",
+                "npm-asset/css-loader": ">=0.28.10,<0.29.0",
                 "npm-asset/del": ">=2.2.1,<3.0.0",
                 "npm-asset/dts-generator": ">=2.1.0,<3.0.0",
-                "npm-asset/eslint": ">=4.13.1,<5.0.0",
-                "npm-asset/eslint-config-standard": ">=11.0.0-beta.0,<12.0.0",
-                "npm-asset/eslint-plugin-import": ">=2.8.0,<3.0.0",
+                "npm-asset/eslint": ">=4.18.2,<5.0.0",
+                "npm-asset/eslint-config-standard": ">=11.0.0,<12.0.0",
+                "npm-asset/eslint-plugin-import": ">=2.9.0,<3.0.0",
                 "npm-asset/eslint-plugin-node": ">=5.2.1,<6.0.0",
                 "npm-asset/eslint-plugin-promise": ">=3.6.0,<4.0.0",
                 "npm-asset/eslint-plugin-standard": ">=3.0.1,<4.0.0",
                 "npm-asset/gulp-modify-file": ">=1.0.0,<2.0.0",
                 "npm-asset/gulp-rename": ">=1.2.2,<2.0.0",
                 "npm-asset/gulp-shell": ">=0.6.5,<0.7.0",
-                "npm-asset/gulp-tslint": ">=8.1.2,<9.0.0",
+                "npm-asset/gulp-tslint": ">=8.1.3,<9.0.0",
                 "npm-asset/gulp-uglify": ">=2.0.0,<3.0.0",
                 "npm-asset/gulp-util": ">=3.0.7,<4.0.0",
                 "npm-asset/gulp-watch": ">=4.3.11,<5.0.0",
                 "npm-asset/native-promise-only": ">=0.8.1,<0.9.0",
                 "npm-asset/node-sass": ">=4.7.2,<5.0.0",
                 "npm-asset/phantomjs-prebuilt": ">=2.1.7,<3.0.0",
-                "npm-asset/sass-loader": ">=6.0.6,<7.0.0",
+                "npm-asset/sass-loader": ">=6.0.7,<7.0.0",
                 "npm-asset/tslib": ">=1.8.0,<2.0.0",
                 "npm-asset/tslint": ">=5.8.0,<6.0.0",
                 "npm-asset/tslint-config-standard": ">=7.0.0,<8.0.0",
                 "npm-asset/types--jquery": "2.0.47",
-                "npm-asset/typescript": ">=2.6.2,<3.0.0",
-                "npm-asset/webpack": ">=3.8.1,<4.0.0",
-                "npm-asset/webpack-stream": ">=4.0.0,<5.0.0",
+                "npm-asset/typescript": ">=2.7.2,<3.0.0",
+                "npm-asset/webpack": ">=3.11.0,<4.0.0",
+                "npm-asset/webpack-stream": ">=4.0.2,<5.0.0",
                 "npm-asset/yargs": ">=4.8.1,<5.0.0"
             },
             "type": "npm-asset-library",
                 "full-sized",
                 "jquery-plugin"
             ],
-            "time": "2018-01-30T23:49:01+00:00"
+            "time": "2018-03-05T03:30:23+00:00"
         },
         {
             "name": "npm-asset/jgrowl",
         },
         {
             "name": "npm-asset/jquery-datetimepicker",
-            "version": "2.5.17",
+            "version": "2.5.20",
             "dist": {
                 "type": "tar",
-                "url": "https://registry.npmjs.org/jquery-datetimepicker/-/jquery-datetimepicker-2.5.17.tgz",
+                "url": "https://registry.npmjs.org/jquery-datetimepicker/-/jquery-datetimepicker-2.5.20.tgz",
                 "reference": null,
-                "shasum": "8857a631f248081d4072563bde40fa8c17e407b1"
+                "shasum": "687d6204b90b03dc93f725f8df036e1d061f37ac"
             },
             "require": {
                 "npm-asset/jquery": ">=1.7.2",
                 "npm-asset/php-date-formatter": ">=1.3.4,<2.0.0"
             },
             "require-dev": {
+                "npm-asset/chai": ">=4.1.2,<5.0.0",
                 "npm-asset/concat": "dev-github:azer/concat",
                 "npm-asset/concat-cli": ">=4.0.0,<5.0.0",
+                "npm-asset/karma": ">=2.0.0,<3.0.0",
+                "npm-asset/karma-chai": ">=0.1.0,<0.2.0",
+                "npm-asset/karma-firefox-launcher": ">=1.1.0,<2.0.0",
+                "npm-asset/karma-mocha": ">=1.3.0,<2.0.0",
+                "npm-asset/mocha": ">=5.0.4,<6.0.0",
                 "npm-asset/uglifycss": ">=0.0.27,<0.0.28",
                 "npm-asset/uglifyjs": ">=2.4.10,<3.0.0"
             },
                     "url": "git+https://github.com/xdan/datetimepicker.git"
                 },
                 "npm-asset-scripts": {
-                    "test": "echo \"Error: no test specified\" && exit 1",
+                    "test": "karma start --browsers Firefox karma.conf.js --single-run",
                     "concat": "concat-cli -f node_modules/php-date-formatter/js/php-date-formatter.min.js jquery.datetimepicker.js node_modules/jquery-mousewheel/jquery.mousewheel.js -o build/jquery.datetimepicker.full.js",
                     "minify": "uglifyjs jquery.datetimepicker.js -c -m -o build/jquery.datetimepicker.min.js && uglifycss jquery.datetimepicker.css > build/jquery.datetimepicker.min.css",
                     "minifyconcat": "uglifyjs build/jquery.datetimepicker.full.js -c -m -o build/jquery.datetimepicker.full.min.js",
                     "github": "git add --all  && git commit -m \"New version %npm_package_version% \" && git tag %npm_package_version% && git push --tags origin HEAD:master && npm publish",
                     "build": "npm run minify && npm run concat && npm run minifyconcat",
-                    "public": "npm version patch --no-git-tag-version && npm run build && npm run github"
+                    "public": "npm run test && npm version patch --no-git-tag-version && npm run build && npm run github"
                 }
             },
             "license": [
                 {
                     "name": "Chupurnov",
                     "email": "chupurnov@gmail.com",
-                    "url": "http://xdsoft.net/"
+                    "url": "https://xdsoft.net/"
                 }
             ],
             "description": "jQuery Plugin DateTimePicker it is DatePicker and TimePicker in one",
                 "time",
                 "timepicker"
             ],
-            "time": "2018-01-23T05:56:50+00:00"
+            "time": "2018-03-21T16:26:39+00:00"
         },
         {
             "name": "npm-asset/jquery-mousewheel",
         },
         {
             "name": "npm-asset/moment",
-            "version": "2.20.1",
+            "version": "2.21.0",
             "dist": {
                 "type": "tar",
-                "url": "https://registry.npmjs.org/moment/-/moment-2.20.1.tgz",
+                "url": "https://registry.npmjs.org/moment/-/moment-2.21.0.tgz",
                 "reference": null,
-                "shasum": "d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd"
+                "shasum": "2a114b51d2a6ec9e6d83cf803f838a878d8a023a"
             },
             "require-dev": {
                 "npm-asset/benchmark": "dev-default|*",
                 "time",
                 "validate"
             ],
-            "time": "2017-12-19T04:44:18+00:00"
+            "time": "2018-03-02T20:41:10+00:00"
         },
         {
             "name": "npm-asset/php-date-formatter",
         },
         {
             "name": "paragonie/sodium_compat",
-            "version": "v1.6.0",
+            "version": "v1.6.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/paragonie/sodium_compat.git",
-                "reference": "1f6e5682eff4a5a6a394b14331a1904f1740e432"
+                "reference": "9857e17bf9c1464485d8cc804eb13f2bcddc4cf0"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/1f6e5682eff4a5a6a394b14331a1904f1740e432",
-                "reference": "1f6e5682eff4a5a6a394b14331a1904f1740e432",
+                "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/9857e17bf9c1464485d8cc804eb13f2bcddc4cf0",
+                "reference": "9857e17bf9c1464485d8cc804eb13f2bcddc4cf0",
                 "shasum": ""
             },
             "require": {
                 "secret-key cryptography",
                 "side-channel resistant"
             ],
-            "time": "2018-02-15T05:50:20+00:00"
+            "time": "2018-03-21T17:08:08+00:00"
         },
         {
             "name": "pear/console_getopt",
index ef76b5ffbe8f3a67a1ee93c6e8e3d41bb88a0bd4..30dbeeff0928150aa92eeb71c1ad5eca20c82c98 100644 (file)
@@ -201,6 +201,10 @@ blockquote.shared_content {
   content: ' Â»';
 }
 
+#profile-photo-wrapper {
+  overflow: hidden;
+}
+
 /* headers */
 h1, h2, h3, h4, h5, h6 {
   margin: 5px 0px 5px 0px;
diff --git a/view/js/cropper/cropper.css b/view/js/cropper/cropper.css
deleted file mode 100644 (file)
index c2e7598..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-.imgCrop_wrap {\r
-       /* width: 500px;   @done_in_js */\r
-       /* height: 375px;  @done_in_js */\r
-       position: relative;\r
-       cursor: crosshair;\r
-}\r
-\r
-/* an extra classname is applied for Opera < 9.0 to fix it's lack of opacity support */\r
-.imgCrop_wrap.opera8 .imgCrop_overlay,\r
-.imgCrop_wrap.opera8 .imgCrop_clickArea { \r
-       background-color: transparent;\r
-}\r
-\r
-/* fix for IE displaying all boxes at line-height by default, although they are still 1 pixel high until we combine them with the pointless span */\r
-.imgCrop_wrap,\r
-.imgCrop_wrap * {\r
-       font-size: 0;\r
-}\r
-\r
-.imgCrop_overlay {\r
-       background-color: #000;\r
-       opacity: 0.5;\r
-       filter:alpha(opacity=50);\r
-       position: absolute;\r
-       width: 100%;\r
-       height: 100%;\r
-}\r
-\r
-.imgCrop_selArea {\r
-       position: absolute;\r
-       /* @done_in_js \r
-       top: 20px;\r
-       left: 20px;\r
-       width: 200px;\r
-       height: 200px;\r
-       background: transparent url(castle.jpg) no-repeat  -210px -110px;\r
-       */\r
-       cursor: move;\r
-       z-index: 2;\r
-}\r
-\r
-/* clickArea is all a fix for IE 5.5 & 6 to allow the user to click on the given area */\r
-.imgCrop_clickArea {\r
-       width: 100%;\r
-       height: 100%;\r
-       background-color: #FFF;\r
-       opacity: 0.01;\r
-       filter:alpha(opacity=01);\r
-}\r
-\r
-.imgCrop_marqueeHoriz {\r
-       position: absolute;\r
-       width: 100%;\r
-       height: 1px;\r
-       background: transparent url(marqueeHoriz.gif) repeat-x 0 0;\r
-       z-index: 3;\r
-}\r
-\r
-.imgCrop_marqueeVert {\r
-       position: absolute;\r
-       height: 100%;\r
-       width: 1px;\r
-       background: transparent url(marqueeVert.gif) repeat-y 0 0;\r
-       z-index: 3;\r
-}\r
-\r
-/* \r
- *  FIX MARCHING ANTS IN IE\r
- *     As IE <6 tries to load background images we can uncomment the follwoing hack \r
- *  to remove that issue, not as pretty - but is anything in IE?\r
- *  And yes I do know that 'filter' is evil, but it will make it look semi decent in IE\r
- *\r
-* html .imgCrop_marqueeHoriz,\r
-* html .imgCrop_marqueeVert {\r
-       background: transparent;\r
-       filter: Invert; \r
-}\r
-* html .imgCrop_marqueeNorth { border-top: 1px dashed #000; }\r
-* html .imgCrop_marqueeEast  { border-right: 1px dashed #000; }\r
-* html .imgCrop_marqueeSouth { border-bottom: 1px dashed #000; }\r
-* html .imgCrop_marqueeWest  { border-left: 1px dashed #000; }\r
-*/\r
-\r
-.imgCrop_marqueeNorth { top: 0; left: 0; }\r
-.imgCrop_marqueeEast  { top: 0; right: 0; }\r
-.imgCrop_marqueeSouth { bottom: 0px; left: 0; }\r
-.imgCrop_marqueeWest  { top: 0; left: 0; }\r
-\r
-\r
-.imgCrop_handle {\r
-       position: absolute;\r
-       border: 1px solid #333;\r
-       width: 6px;\r
-       height: 6px;\r
-       background: #FFF;\r
-       opacity: 0.5;\r
-       filter:alpha(opacity=50);\r
-       z-index: 4;\r
-}\r
-\r
-/* fix IE 5 box model */\r
-* html .imgCrop_handle {\r
-       width: 8px;\r
-       height: 8px;\r
-       wid\th: 6px;\r
-       hei\ght: 6px;\r
-}\r
-\r
-.imgCrop_handleN {\r
-       top: -3px;\r
-       left: 0;\r
-       /* margin-left: 49%;    @done_in_js */\r
-       cursor: n-resize;\r
-}\r
-\r
-.imgCrop_handleNE { \r
-       top: -3px;\r
-       right: -3px;\r
-       cursor: ne-resize;\r
-}\r
-\r
-.imgCrop_handleE {\r
-       top: 0;\r
-       right: -3px;\r
-       /* margin-top: 49%;    @done_in_js */\r
-       cursor: e-resize;\r
-}\r
-\r
-.imgCrop_handleSE {\r
-       right: -3px;\r
-       bottom: -3px;\r
-       cursor: se-resize;\r
-}\r
-\r
-.imgCrop_handleS {\r
-       right: 0;\r
-       bottom: -3px;\r
-       /* margin-right: 49%; @done_in_js */\r
-       cursor: s-resize;\r
-}\r
-\r
-.imgCrop_handleSW {\r
-       left: -3px;\r
-       bottom: -3px;\r
-       cursor: sw-resize;\r
-}\r
-\r
-.imgCrop_handleW {\r
-       top: 0;\r
-       left: -3px;\r
-       /* margin-top: 49%;  @done_in_js */\r
-       cursor: w-resize;\r
-}\r
-\r
-.imgCrop_handleNW {\r
-       top: -3px;\r
-       left: -3px;\r
-       cursor: nw-resize;\r
-}\r
-\r
-/**\r
- * Create an area to click & drag around on as the default browser behaviour is to let you drag the image \r
- */\r
-.imgCrop_dragArea {\r
-       width: 100%;\r
-       height: 100%;\r
-       z-index: 200;\r
-       position: absolute;\r
-       top: 0;\r
-       left: 0;\r
-}\r
-\r
-.imgCrop_previewWrap {\r
-       /* width: 200px;  @done_in_js */\r
-       /* height: 200px; @done_in_js */\r
-       overflow: hidden;\r
-       position: relative;\r
-}\r
-\r
-.imgCrop_previewWrap img {\r
-       position: absolute;\r
-}
\ No newline at end of file
diff --git a/view/js/cropper/cropper.html b/view/js/cropper/cropper.html
deleted file mode 100644 (file)
index ebdf1ff..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-   1.
-      <script type="text/javascript" src="scripts/cropper/lib/prototype.js" language="javascript"></script>
-   2.
-      <script type="text/javascript" src="scripts/cropper/lib/scriptaculous.js?load=builder,dragdrop" language="javascript"></script>
-   3.
-      <script type="text/javascript" src="scripts/cropper/cropper.js" language="javascript"></script>
-
-Options
-
-ratioDim obj
-    The pixel dimensions to apply as a restrictive ratio, with properties x & y.
-minWidth int
-    The minimum width for the select area in pixels.
-minHeight int
-    The mimimum height for the select area in pixels.
-maxWidth int
-    The maximum width for the select areas in pixels (if both minWidth & maxWidth set to same the width of the cropper will be fixed)
-maxHeight int
-    The maximum height for the select areas in pixels (if both minHeight & maxHeight set to same the height of the cropper will be fixed)
-displayOnInit int
-    Whether to display the select area on initialisation, only used when providing minimum width & height or ratio.
-onEndCrop func
-    The callback function to provide the crop details to on end of a crop.
-captureKeys boolean
-    Whether to capture the keys for moving the select area, as these can cause some problems at the moment.
-onloadCoords obj
-    A coordinates object with properties x1, y1, x2 & y2; for the coordinates of the select area to display onload
-
-The callback function
-
-The callback function is a function that allows you to capture the crop co-ordinates when the user finished a crop movement, it is passed two arguments:
-
-    * coords, obj, coordinates object with properties x1, y1, x2 & y2; for the coordinates of the select area.
-    * dimensions, obj, dimensions object with properities width & height; for the dimensions of the select area.
-
-An example function which outputs the crop values to form fields:
-Display code as plain text
-JavaScript:
-
-   1.
-      function onEndCrop( coords, dimensions ) {
-   2.
-          $PR( 'x1' ).value = coords.x1;
-   3.
-          $PR( 'y1' ).value = coords.y1;
-   4.
-          $PR( 'x2' ).value = coords.x2;
-   5.
-          $PR( 'y2' ).value = coords.y2;
-   6.
-          $PR( 'width' ).value = dimensions.width;
-   7.
-          $PR( 'height' ).value = dimensions.height;
-   8.
-      }
-
-Basic interface
-
-This basic example will attach the cropper UI to the test image and return crop results to the provided callback function.
-Display code as plain text
-HTML:
-
-   1.
-      <img src="test.jpg" alt="Test image" id="testImage" width="500" height="333" />
-   2.
-       
-   3.
-          <script type="text/javascript" language="javascript">
-   4.
-          Event.observe( window, 'load', function() {
-   5.
-              new Cropper.Img(
-   6.
-                  'testImage',
-   7.
-                  { onEndCrop: onEndCrop }
-   8.
-              );
-   9.
-          } );
-  10.
-      </script>
-
-Minimum dimensions
-
-You can apply minimum dimensions to a single axis or both, this example applies minimum dimensions to both axis.
-Display code as plain text
-HTML:
-
-   1.
-      <img src="test.jpg" alt="Test image" id="testImage" width="500" height="333" />
-   2.
-       
-   3.
-      <script type="text/javascript" language="javascript">
-   4.
-          Event.observe( window, 'load', function() {
-   5.
-              new Cropper.Img(
-   6.
-                  'testImage',
-   7.
-                  {
-   8.
-                      minWidth: 220,
-   9.
-                      minHeight: 120,
-  10.
-                      onEndCrop: onEndCrop
-  11.
-                  }
-  12.
-              );
-  13.
-          } );
-  14.
-      </script>
-
-Select area ratio
-
-You can apply a ratio to the selection area, this example applies a 4:3 ratio to the select area.
-Display code as plain text
-HTML:
-
-   1.
-      <img src="test.jpg" alt="Test image" id="testImage" width="500" height="333" />
-   2.
-       
-   3.
-      <script type="text/javascript" language="javascript">
-   4.
-          Event.observe( window, 'load', function() {
-   5.
-              new Cropper.Img(
-   6.
-                  'testImage',
-   7.
-                  {
-   8.
-                      ratioDim: {
-   9.
-                          x: 220,
-  10.
-                          y: 165
-  11.
-                      },
-  12.
-                      displayOnInit: true,
-  13.
-                      onEndCrop: onEndCrop
-  14.
-                  }
-  15.
-              );
-  16.
-          } );
-  17.
-      </script>
-
-With crop preview
-
-You can display a dynamically prouced preview of the resulting crop by using the ImgWithPreview subclass, a preview can only be displayed when we have a fixed size (set via minWidth & minHeight options). Note that the displayOnInit option is not required as this is the default behaviour when displaying a crop preview.
-Display code as plain text
-HTML:
-
-   1.
-      <img src="test.jpg" alt="Test image" id="testImage" width="500" height="333" />
-   2.
-      <div id="previewWrap"></div>
-   3.
-       
-   4.
-      <script type="text/javascript" language="javascript">
-   5.
-          Event.observe( window, 'load', function() {
-   6.
-              new Cropper.ImgWithPreview(
-   7.
-                  'testImage',
-   8.
-                  {
-   9.
-                      previewWrap: 'previewWrap',
-  10.
-                      minWidth: 120,
-  11.
-                      minHeight: 120,
-  12.
-                      ratioDim: { x: 200, y: 120 },
-  13.
-                      onEndCrop: onEndCrop
-  14.
-                  }
-  15.
-              );
-  16.
-          } );
-  17.
-      </script>
-
-Known Issues
-
-    * Safari animated gifs, only one of each will animate, this seems to be a known Safari issue.
-    * After drawing an area and then clicking to start a new drag in IE 5.5 the rendered height appears as the last height until the user drags, this appears to be the related to another IE error (which has been fixed) where IE does not always redraw the select area properly.
-    * Lack of CSS opacity support in Opera before version 9 mean we disable those style rules, if Opera 8 support is important you & you want the overlay to work then you can use the Opera rules in the CSS to apply a black PNG with 50% alpha transparency to replicate the effect.
-    * Styling & borders on image, any CSS styling applied directly to the image itself (floats, borders, padding, margin, etc.) will cause problems with the cropper. The use of a wrapper element to apply these styles to is recommended.
-    * overflow: auto or overflow: scroll on parent will cause cropper to burst out of parent in IE and Opera when applied (maybe Mac browsers too) I'm not sure why yet.
-
-If you use CakePHP you will notice that including this in your script will break the CSS layout. This is due to the CSS rule
-
-form div{
-vertical-align: text-top;
-margin-left: 1em;
-margin-bottom:2em;
-overflow: auto;
-}
-
-A simple workaround is to add another rule directly after this like so:
-
-form div.no_cake, form div.no_cake div {
-margin:0;
-overflow:hidden;
-}
-
-and then in your code surround the img tag with a div with the class name of no_cake.
-
-Cheers
-
diff --git a/view/js/cropper/cropper.js b/view/js/cropper/cropper.js
deleted file mode 100644 (file)
index 427a9ba..0000000
+++ /dev/null
@@ -1,568 +0,0 @@
-/** \r
- * Copyright (c) 2006, David Spurr (http://www.defusion.org.uk/)\r
- * All rights reserved.\r
- * \r
- * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r
- * \r
- *     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
- *     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r
- *     * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\r
- * \r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- * \r
- * http://www.opensource.org/licenses/bsd-license.php\r
- * \r
- * See scriptaculous.js for full scriptaculous licence\r
- *\r
- * Modified 2013/06/01 Zach P to change $() to $PR() for eliminating conflicts with jQuery\r
- */\r
-\r
-var CropDraggable=Class.create();\r
-Object.extend(Object.extend(CropDraggable.prototype,Draggable.prototype),{initialize:function(_1){\r
-this.options=Object.extend({drawMethod:function(){\r
-}},arguments[1]||{});\r
-this.element=$PR(_1);\r
-this.handle=this.element;\r
-this.delta=this.currentDelta();\r
-this.dragging=false;\r
-this.eventMouseDown=this.initDrag.bindAsEventListener(this);\r
-Event.observe(this.handle,"mousedown",this.eventMouseDown);\r
-Draggables.register(this);\r
-},draw:function(_2){\r
-var _3=Position.cumulativeOffset(this.element);\r
-var d=this.currentDelta();\r
-_3[0]-=d[0];\r
-_3[1]-=d[1];\r
-var p=[0,1].map(function(i){\r
-return (_2[i]-_3[i]-this.offset[i]);\r
-}.bind(this));\r
-this.options.drawMethod(p);\r
-}});\r
-var Cropper={};\r
-Cropper.Img=Class.create();\r
-Cropper.Img.prototype={initialize:function(_7,_8){\r
-this.options=Object.extend({ratioDim:{x:0,y:0},minWidth:0,minHeight:0,displayOnInit:false,onEndCrop:Prototype.emptyFunction,captureKeys:true,onloadCoords:null,maxWidth:0,maxHeight:0},_8||{});\r
-this.img=$PR(_7);\r
-this.clickCoords={x:0,y:0};\r
-this.dragging=false;\r
-this.resizing=false;\r
-this.isWebKit=/Konqueror|Safari|KHTML/.test(navigator.userAgent);\r
-this.isIE=/MSIE/.test(navigator.userAgent);\r
-this.isOpera8=/Opera\s[1-8]/.test(navigator.userAgent);\r
-this.ratioX=0;\r
-this.ratioY=0;\r
-this.attached=false;\r
-this.fixedWidth=(this.options.maxWidth>0&&(this.options.minWidth>=this.options.maxWidth));\r
-this.fixedHeight=(this.options.maxHeight>0&&(this.options.minHeight>=this.options.maxHeight));\r
-if(typeof this.img=="undefined"){\r
-return;\r
-}\r
-$A(document.getElementsByTagName("script")).each(function(s){\r
-if(s.src.match(/cropper\.js/)){\r
-var _a=s.src.replace(/cropper\.js(.*)?/,"");\r
-var _b=document.createElement("link");\r
-_b.rel="stylesheet";\r
-_b.type="text/css";\r
-_b.href=_a+"cropper.css";\r
-_b.media="screen";\r
-document.getElementsByTagName("head")[0].appendChild(_b);\r
-}\r
-});\r
-if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){\r
-var _c=this.getGCD(this.options.ratioDim.x,this.options.ratioDim.y);\r
-this.ratioX=this.options.ratioDim.x/_c;\r
-this.ratioY=this.options.ratioDim.y/_c;\r
-}\r
-this.subInitialize();\r
-if(this.img.complete||this.isWebKit){\r
-this.onLoad();\r
-}else{\r
-Event.observe(this.img,"load",this.onLoad.bindAsEventListener(this));\r
-}\r
-},getGCD:function(a,b){\r
-if(b==0){\r
-return a;\r
-}\r
-return this.getGCD(b,a%b);\r
-},onLoad:function(){\r
-var _f="imgCrop_";\r
-var _10=this.img.parentNode;\r
-var _11="";\r
-if(this.isOpera8){\r
-_11=" opera8";\r
-}\r
-this.imgWrap=Builder.node("div",{"class":_f+"wrap"+_11});\r
-this.north=Builder.node("div",{"class":_f+"overlay "+_f+"north"},[Builder.node("span")]);\r
-this.east=Builder.node("div",{"class":_f+"overlay "+_f+"east"},[Builder.node("span")]);\r
-this.south=Builder.node("div",{"class":_f+"overlay "+_f+"south"},[Builder.node("span")]);\r
-this.west=Builder.node("div",{"class":_f+"overlay "+_f+"west"},[Builder.node("span")]);\r
-var _12=[this.north,this.east,this.south,this.west];\r
-this.dragArea=Builder.node("div",{"class":_f+"dragArea"},_12);\r
-this.handleN=Builder.node("div",{"class":_f+"handle "+_f+"handleN"});\r
-this.handleNE=Builder.node("div",{"class":_f+"handle "+_f+"handleNE"});\r
-this.handleE=Builder.node("div",{"class":_f+"handle "+_f+"handleE"});\r
-this.handleSE=Builder.node("div",{"class":_f+"handle "+_f+"handleSE"});\r
-this.handleS=Builder.node("div",{"class":_f+"handle "+_f+"handleS"});\r
-this.handleSW=Builder.node("div",{"class":_f+"handle "+_f+"handleSW"});\r
-this.handleW=Builder.node("div",{"class":_f+"handle "+_f+"handleW"});\r
-this.handleNW=Builder.node("div",{"class":_f+"handle "+_f+"handleNW"});\r
-this.selArea=Builder.node("div",{"class":_f+"selArea"},[Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeNorth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeEast"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeSouth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeWest"},[Builder.node("span")]),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,Builder.node("div",{"class":_f+"clickArea"})]);\r
-this.imgWrap.appendChild(this.img);\r
-this.imgWrap.appendChild(this.dragArea);\r
-this.dragArea.appendChild(this.selArea);\r
-this.dragArea.appendChild(Builder.node("div",{"class":_f+"clickArea"}));\r
-_10.appendChild(this.imgWrap);\r
-this.startDragBind=this.startDrag.bindAsEventListener(this);\r
-Event.observe(this.dragArea,"mousedown",this.startDragBind);\r
-this.onDragBind=this.onDrag.bindAsEventListener(this);\r
-Event.observe(document,"mousemove",this.onDragBind);\r
-this.endCropBind=this.endCrop.bindAsEventListener(this);\r
-Event.observe(document,"mouseup",this.endCropBind);\r
-this.resizeBind=this.startResize.bindAsEventListener(this);\r
-this.handles=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW];\r
-this.registerHandles(true);\r
-if(this.options.captureKeys){\r
-this.keysBind=this.handleKeys.bindAsEventListener(this);\r
-Event.observe(document,"keypress",this.keysBind);\r
-}\r
-new CropDraggable(this.selArea,{drawMethod:this.moveArea.bindAsEventListener(this)});\r
-this.setParams();\r
-},registerHandles:function(_13){\r
-for(var i=0;i<this.handles.length;i++){\r
-var _15=$PR(this.handles[i]);\r
-if(_13){\r
-var _16=false;\r
-if(this.fixedWidth&&this.fixedHeight){\r
-_16=true;\r
-}else{\r
-if(this.fixedWidth||this.fixedHeight){\r
-var _17=_15.className.match(/([S|N][E|W])$/);\r
-var _18=_15.className.match(/(E|W)$/);\r
-var _19=_15.className.match(/(N|S)$/);\r
-if(_17){\r
-_16=true;\r
-}else{\r
-if(this.fixedWidth&&_18){\r
-_16=true;\r
-}else{\r
-if(this.fixedHeight&&_19){\r
-_16=true;\r
-}\r
-}\r
-}\r
-}\r
-}\r
-if(_16){\r
-_15.hide();\r
-}else{\r
-Event.observe(_15,"mousedown",this.resizeBind);\r
-}\r
-}else{\r
-_15.show();\r
-Event.stopObserving(_15,"mousedown",this.resizeBind);\r
-}\r
-}\r
-},setParams:function(){\r
-this.imgW=this.img.width;\r
-this.imgH=this.img.height;\r
-$PR(this.north).setStyle({height:0});\r
-$PR(this.east).setStyle({width:0,height:0});\r
-$PR(this.south).setStyle({height:0});\r
-$PR(this.west).setStyle({width:0,height:0});\r
-$PR(this.imgWrap).setStyle({"width":this.imgW+"px","height":this.imgH+"px"});\r
-$PR(this.selArea).hide();\r
-var _1a={x1:0,y1:0,x2:0,y2:0};\r
-var _1b=false;\r
-if(this.options.onloadCoords!=null){\r
-_1a=this.cloneCoords(this.options.onloadCoords);\r
-_1b=true;\r
-}else{\r
-if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){\r
-_1a.x1=Math.ceil((this.imgW-this.options.ratioDim.x)/2);\r
-_1a.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2);\r
-_1a.x2=_1a.x1+this.options.ratioDim.x;\r
-_1a.y2=_1a.y1+this.options.ratioDim.y;\r
-_1b=true;\r
-}\r
-}\r
-this.setAreaCoords(_1a,false,false,1);\r
-if(this.options.displayOnInit&&_1b){\r
-this.selArea.show();\r
-this.drawArea();\r
-this.endCrop();\r
-}\r
-this.attached=true;\r
-},remove:function(){\r
-if(this.attached){\r
-this.attached=false;\r
-this.imgWrap.parentNode.insertBefore(this.img,this.imgWrap);\r
-this.imgWrap.parentNode.removeChild(this.imgWrap);\r
-Event.stopObserving(this.dragArea,"mousedown",this.startDragBind);\r
-Event.stopObserving(document,"mousemove",this.onDragBind);\r
-Event.stopObserving(document,"mouseup",this.endCropBind);\r
-this.registerHandles(false);\r
-if(this.options.captureKeys){\r
-Event.stopObserving(document,"keypress",this.keysBind);\r
-}\r
-}\r
-},reset:function(){\r
-if(!this.attached){\r
-this.onLoad();\r
-}else{\r
-this.setParams();\r
-}\r
-this.endCrop();\r
-},handleKeys:function(e){\r
-var dir={x:0,y:0};\r
-if(!this.dragging){\r
-switch(e.keyCode){\r
-case (37):\r
-dir.x=-1;\r
-break;\r
-case (38):\r
-dir.y=-1;\r
-break;\r
-case (39):\r
-dir.x=1;\r
-break;\r
-case (40):\r
-dir.y=1;\r
-break;\r
-}\r
-if(dir.x!=0||dir.y!=0){\r
-if(e.shiftKey){\r
-dir.x*=10;\r
-dir.y*=10;\r
-}\r
-this.moveArea([this.areaCoords.x1+dir.x,this.areaCoords.y1+dir.y]);\r
-Event.stop(e);\r
-}\r
-}\r
-},calcW:function(){\r
-return (this.areaCoords.x2-this.areaCoords.x1);\r
-},calcH:function(){\r
-return (this.areaCoords.y2-this.areaCoords.y1);\r
-},moveArea:function(_1e){\r
-this.setAreaCoords({x1:_1e[0],y1:_1e[1],x2:_1e[0]+this.calcW(),y2:_1e[1]+this.calcH()},true,false);\r
-this.drawArea();\r
-},cloneCoords:function(_1f){\r
-return {x1:_1f.x1,y1:_1f.y1,x2:_1f.x2,y2:_1f.y2};\r
-},setAreaCoords:function(_20,_21,_22,_23,_24){\r
-if(_21){\r
-var _25=_20.x2-_20.x1;\r
-var _26=_20.y2-_20.y1;\r
-if(_20.x1<0){\r
-_20.x1=0;\r
-_20.x2=_25;\r
-}\r
-if(_20.y1<0){\r
-_20.y1=0;\r
-_20.y2=_26;\r
-}\r
-if(_20.x2>this.imgW){\r
-_20.x2=this.imgW;\r
-_20.x1=this.imgW-_25;\r
-}\r
-if(_20.y2>this.imgH){\r
-_20.y2=this.imgH;\r
-_20.y1=this.imgH-_26;\r
-}\r
-}else{\r
-if(_20.x1<0){\r
-_20.x1=0;\r
-}\r
-if(_20.y1<0){\r
-_20.y1=0;\r
-}\r
-if(_20.x2>this.imgW){\r
-_20.x2=this.imgW;\r
-}\r
-if(_20.y2>this.imgH){\r
-_20.y2=this.imgH;\r
-}\r
-if(_23!=null){\r
-if(this.ratioX>0){\r
-this.applyRatio(_20,{x:this.ratioX,y:this.ratioY},_23,_24);\r
-}else{\r
-if(_22){\r
-this.applyRatio(_20,{x:1,y:1},_23,_24);\r
-}\r
-}\r
-var _27=[this.options.minWidth,this.options.minHeight];\r
-var _28=[this.options.maxWidth,this.options.maxHeight];\r
-if(_27[0]>0||_27[1]>0||_28[0]>0||_28[1]>0){\r
-var _29={a1:_20.x1,a2:_20.x2};\r
-var _2a={a1:_20.y1,a2:_20.y2};\r
-var _2b={min:0,max:this.imgW};\r
-var _2c={min:0,max:this.imgH};\r
-if((_27[0]!=0||_27[1]!=0)&&_22){\r
-if(_27[0]>0){\r
-_27[1]=_27[0];\r
-}else{\r
-if(_27[1]>0){\r
-_27[0]=_27[1];\r
-}\r
-}\r
-}\r
-if((_28[0]!=0||_28[0]!=0)&&_22){\r
-if(_28[0]>0&&_28[0]<=_28[1]){\r
-_28[1]=_28[0];\r
-}else{\r
-if(_28[1]>0&&_28[1]<=_28[0]){\r
-_28[0]=_28[1];\r
-}\r
-}\r
-}\r
-if(_27[0]>0){\r
-this.applyDimRestriction(_29,_27[0],_23.x,_2b,"min");\r
-}\r
-if(_27[1]>1){\r
-this.applyDimRestriction(_2a,_27[1],_23.y,_2c,"min");\r
-}\r
-if(_28[0]>0){\r
-this.applyDimRestriction(_29,_28[0],_23.x,_2b,"max");\r
-}\r
-if(_28[1]>1){\r
-this.applyDimRestriction(_2a,_28[1],_23.y,_2c,"max");\r
-}\r
-_20={x1:_29.a1,y1:_2a.a1,x2:_29.a2,y2:_2a.a2};\r
-}\r
-}\r
-}\r
-this.areaCoords=_20;\r
-},applyDimRestriction:function(_2d,val,_2f,_30,_31){\r
-var _32;\r
-if(_31=="min"){\r
-_32=((_2d.a2-_2d.a1)<val);\r
-}else{\r
-_32=((_2d.a2-_2d.a1)>val);\r
-}\r
-if(_32){\r
-if(_2f==1){\r
-_2d.a2=_2d.a1+val;\r
-}else{\r
-_2d.a1=_2d.a2-val;\r
-}\r
-if(_2d.a1<_30.min){\r
-_2d.a1=_30.min;\r
-_2d.a2=val;\r
-}else{\r
-if(_2d.a2>_30.max){\r
-_2d.a1=_30.max-val;\r
-_2d.a2=_30.max;\r
-}\r
-}\r
-}\r
-},applyRatio:function(_33,_34,_35,_36){\r
-var _37;\r
-if(_36=="N"||_36=="S"){\r
-_37=this.applyRatioToAxis({a1:_33.y1,b1:_33.x1,a2:_33.y2,b2:_33.x2},{a:_34.y,b:_34.x},{a:_35.y,b:_35.x},{min:0,max:this.imgW});\r
-_33.x1=_37.b1;\r
-_33.y1=_37.a1;\r
-_33.x2=_37.b2;\r
-_33.y2=_37.a2;\r
-}else{\r
-_37=this.applyRatioToAxis({a1:_33.x1,b1:_33.y1,a2:_33.x2,b2:_33.y2},{a:_34.x,b:_34.y},{a:_35.x,b:_35.y},{min:0,max:this.imgH});\r
-_33.x1=_37.a1;\r
-_33.y1=_37.b1;\r
-_33.x2=_37.a2;\r
-_33.y2=_37.b2;\r
-}\r
-},applyRatioToAxis:function(_38,_39,_3a,_3b){\r
-var _3c=Object.extend(_38,{});\r
-var _3d=_3c.a2-_3c.a1;\r
-var _3e=Math.floor(_3d*_39.b/_39.a);\r
-var _3f;\r
-var _40;\r
-var _41=null;\r
-if(_3a.b==1){\r
-_3f=_3c.b1+_3e;\r
-if(_3f>_3b.max){\r
-_3f=_3b.max;\r
-_41=_3f-_3c.b1;\r
-}\r
-_3c.b2=_3f;\r
-}else{\r
-_3f=_3c.b2-_3e;\r
-if(_3f<_3b.min){\r
-_3f=_3b.min;\r
-_41=_3f+_3c.b2;\r
-}\r
-_3c.b1=_3f;\r
-}\r
-if(_41!=null){\r
-_40=Math.floor(_41*_39.a/_39.b);\r
-if(_3a.a==1){\r
-_3c.a2=_3c.a1+_40;\r
-}else{\r
-_3c.a1=_3c.a1=_3c.a2-_40;\r
-}\r
-}\r
-return _3c;\r
-},drawArea:function(){\r
-var _42=this.calcW();\r
-var _43=this.calcH();\r
-var px="px";\r
-var _45=[this.areaCoords.x1+px,this.areaCoords.y1+px,_42+px,_43+px,this.areaCoords.x2+px,this.areaCoords.y2+px,(this.img.width-this.areaCoords.x2)+px,(this.img.height-this.areaCoords.y2)+px];\r
-var _46=this.selArea.style;\r
-_46.left=_45[0];\r
-_46.top=_45[1];\r
-_46.width=_45[2];\r
-_46.height=_45[3];\r
-var _47=Math.ceil((_42-6)/2)+px;\r
-var _48=Math.ceil((_43-6)/2)+px;\r
-this.handleN.style.left=_47;\r
-this.handleE.style.top=_48;\r
-this.handleS.style.left=_47;\r
-this.handleW.style.top=_48;\r
-this.north.style.height=_45[1];\r
-var _49=this.east.style;\r
-_49.top=_45[1];\r
-_49.height=_45[3];\r
-_49.left=_45[4];\r
-_49.width=_45[6];\r
-var _4a=this.south.style;\r
-_4a.top=_45[5];\r
-_4a.height=_45[7];\r
-var _4b=this.west.style;\r
-_4b.top=_45[1];\r
-_4b.height=_45[3];\r
-_4b.width=_45[0];\r
-this.subDrawArea();\r
-this.forceReRender();\r
-},forceReRender:function(){\r
-if(this.isIE||this.isWebKit){\r
-var n=document.createTextNode(" ");\r
-var d,el,fixEL,i;\r
-if(this.isIE){\r
-fixEl=this.selArea;\r
-}else{\r
-if(this.isWebKit){\r
-fixEl=document.getElementsByClassName("imgCrop_marqueeSouth",this.imgWrap)[0];\r
-d=Builder.node("div","");\r
-d.style.visibility="hidden";\r
-var _4e=["SE","S","SW"];\r
-for(i=0;i<_4e.length;i++){\r
-el=document.getElementsByClassName("imgCrop_handle"+_4e[i],this.selArea)[0];\r
-if(el.childNodes.length){\r
-el.removeChild(el.childNodes[0]);\r
-}\r
-el.appendChild(d);\r
-}\r
-}\r
-}\r
-fixEl.appendChild(n);\r
-fixEl.removeChild(n);\r
-}\r
-},startResize:function(e){\r
-this.startCoords=this.cloneCoords(this.areaCoords);\r
-this.resizing=true;\r
-this.resizeHandle=Event.element(e).classNames().toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,"");\r
-Event.stop(e);\r
-},startDrag:function(e){\r
-this.selArea.show();\r
-this.clickCoords=this.getCurPos(e);\r
-this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y},false,false,null);\r
-this.dragging=true;\r
-this.onDrag(e);\r
-Event.stop(e);\r
-},getCurPos:function(e){\r
-var el=this.imgWrap,wrapOffsets=Position.cumulativeOffset(el);\r
-while(el.nodeName!="BODY"){\r
-wrapOffsets[1]-=el.scrollTop||0;\r
-wrapOffsets[0]-=el.scrollLeft||0;\r
-el=el.parentNode;\r
-}\r
-return curPos={x:Event.pointerX(e)-wrapOffsets[0],y:Event.pointerY(e)-wrapOffsets[1]};\r
-},onDrag:function(e){\r
-if(this.dragging||this.resizing){\r
-var _54=null;\r
-var _55=this.getCurPos(e);\r
-var _56=this.cloneCoords(this.areaCoords);\r
-var _57={x:1,y:1};\r
-if(this.dragging){\r
-if(_55.x<this.clickCoords.x){\r
-_57.x=-1;\r
-}\r
-if(_55.y<this.clickCoords.y){\r
-_57.y=-1;\r
-}\r
-this.transformCoords(_55.x,this.clickCoords.x,_56,"x");\r
-this.transformCoords(_55.y,this.clickCoords.y,_56,"y");\r
-}else{\r
-if(this.resizing){\r
-_54=this.resizeHandle;\r
-if(_54.match(/E/)){\r
-this.transformCoords(_55.x,this.startCoords.x1,_56,"x");\r
-if(_55.x<this.startCoords.x1){\r
-_57.x=-1;\r
-}\r
-}else{\r
-if(_54.match(/W/)){\r
-this.transformCoords(_55.x,this.startCoords.x2,_56,"x");\r
-if(_55.x<this.startCoords.x2){\r
-_57.x=-1;\r
-}\r
-}\r
-}\r
-if(_54.match(/N/)){\r
-this.transformCoords(_55.y,this.startCoords.y2,_56,"y");\r
-if(_55.y<this.startCoords.y2){\r
-_57.y=-1;\r
-}\r
-}else{\r
-if(_54.match(/S/)){\r
-this.transformCoords(_55.y,this.startCoords.y1,_56,"y");\r
-if(_55.y<this.startCoords.y1){\r
-_57.y=-1;\r
-}\r
-}\r
-}\r
-}\r
-}\r
-this.setAreaCoords(_56,false,e.shiftKey,_57,_54);\r
-this.drawArea();\r
-Event.stop(e);\r
-}\r
-},transformCoords:function(_58,_59,_5a,_5b){\r
-var _5c=[_58,_59];\r
-if(_58>_59){\r
-_5c.reverse();\r
-}\r
-_5a[_5b+"1"]=_5c[0];\r
-_5a[_5b+"2"]=_5c[1];\r
-},endCrop:function(){\r
-this.dragging=false;\r
-this.resizing=false;\r
-this.options.onEndCrop(this.areaCoords,{width:this.calcW(),height:this.calcH()});\r
-},subInitialize:function(){\r
-},subDrawArea:function(){\r
-}};\r
-Cropper.ImgWithPreview=Class.create();\r
-Object.extend(Object.extend(Cropper.ImgWithPreview.prototype,Cropper.Img.prototype),{subInitialize:function(){\r
-this.hasPreviewImg=false;\r
-if(typeof (this.options.previewWrap)!="undefined"&&this.options.minWidth>0&&this.options.minHeight>0){\r
-this.previewWrap=$PR(this.options.previewWrap);\r
-this.previewImg=this.img.cloneNode(false);\r
-this.previewImg.id="imgCrop_"+this.previewImg.id;\r
-this.options.displayOnInit=true;\r
-this.hasPreviewImg=true;\r
-this.previewWrap.addClassName("imgCrop_previewWrap");\r
-this.previewWrap.setStyle({width:this.options.minWidth+"px",height:this.options.minHeight+"px"});\r
-this.previewWrap.appendChild(this.previewImg);\r
-}\r
-},subDrawArea:function(){\r
-if(this.hasPreviewImg){\r
-var _5d=this.calcW();\r
-var _5e=this.calcH();\r
-var _5f={x:this.imgW/_5d,y:this.imgH/_5e};\r
-var _60={x:_5d/this.options.minWidth,y:_5e/this.options.minHeight};\r
-var _61={w:Math.ceil(this.options.minWidth*_5f.x)+"px",h:Math.ceil(this.options.minHeight*_5f.y)+"px",x:"-"+Math.ceil(this.areaCoords.x1/_60.x)+"px",y:"-"+Math.ceil(this.areaCoords.y1/_60.y)+"px"};\r
-var _62=this.previewImg.style;\r
-_62.width=_61.w;\r
-_62.height=_61.h;\r
-_62.left=_61.x;\r
-_62.top=_61.y;\r
-}\r
-}});\r
-\r
diff --git a/view/js/cropper/cropper.uncompressed.js b/view/js/cropper/cropper.uncompressed.js
deleted file mode 100644 (file)
index 0ea0b80..0000000
+++ /dev/null
@@ -1,1333 +0,0 @@
-/**\r
- * Image Cropper (v. 1.2.0 - 2006-10-30 )\r
- * Copyright (c) 2006 David Spurr (http://www.defusion.org.uk/)\r
- * \r
- * The image cropper provides a way to draw a crop area on an image and capture\r
- * the coordinates of the drawn crop area.\r
- * \r
- * Features include:\r
- *             - Based on Prototype and Scriptaculous\r
- *             - Image editing package styling, the crop area functions and looks \r
- *               like those found in popular image editing software\r
- *             - Dynamic inclusion of required styles\r
- *             - Drag to draw areas\r
- *             - Shift drag to draw/resize areas as squares\r
- *             - Selection area can be moved \r
- *             - Seleciton area can be resized using resize handles\r
- *             - Allows dimension ratio limited crop areas\r
- *             - Allows minimum dimension crop areas\r
- *             - Allows maximum dimesion crop areas\r
- *             - If both min & max dimension options set to the same value for a single axis,then the cropper will not \r
- *               display the resize handles as appropriate (when min & max dimensions are passed for both axes this\r
- *               results in a 'fixed size' crop area)\r
- *             - Allows dynamic preview of resultant crop ( if minimum width & height are provided ), this is\r
- *               implemented as a subclass so can be excluded when not required\r
- *             - Movement of selection area by arrow keys ( shift + arrow key will move selection area by\r
- *               10 pixels )\r
- *             - All operations stay within bounds of image\r
- *             - All functionality & display compatible with most popular browsers supported by Prototype:\r
- *                     PC:     IE 7, 6 & 5.5, Firefox 1.5, Opera 8.5 (see known issues) & 9.0b\r
- *                     MAC: Camino 1.0, Firefox 1.5, Safari 2.0\r
- * \r
- * Requires:\r
- *             - Prototype v. 1.5.0_rc0 > (as packaged with Scriptaculous 1.6.1)\r
- *             - Scriptaculous v. 1.6.1 > modules: builder, dragdrop \r
- *             \r
- * Known issues:\r
- *             - Safari animated gifs, only one of each will animate, this seems to be a known Safari issue\r
- * \r
- *             - After drawing an area and then clicking to start a new drag in IE 5.5 the rendered height \r
- *        appears as the last height until the user drags, this appears to be the related to the error \r
- *        that the forceReRender() method fixes for IE 6, i.e. IE 5.5 is not redrawing the box properly.\r
- * \r
- *             - Lack of CSS opacity support in Opera before version 9 mean we disable those style rules, these \r
- *               could be fixed by using PNGs with transparency if Opera 8.5 support is high priority for you\r
- * \r
- *             - Marching ants keep reloading in IE <6 (not tested in IE7), it is a known issue in IE and I have \r
- *        found no viable workarounds that can be included in the release. If this really is an issue for you\r
- *        either try this post: http://mir.aculo.us/articles/2005/08/28/internet-explorer-and-ajax-image-caching-woes\r
- *        or uncomment the 'FIX MARCHING ANTS IN IE' rules in the CSS file\r
- *             \r
- *             - Styling & borders on image, any CSS styling applied directly to the image itself (floats, borders, padding, margin, etc.) will \r
- *               cause problems with the cropper. The use of a wrapper element to apply these styles to is recommended.\r
- * \r
- *             - overflow: auto or overflow: scroll on parent will cause cropper to burst out of parent in IE and Opera (maybe Mac browsers too)\r
- *               I'm not sure why yet.\r
- * \r
- * Usage:\r
- *             See Cropper.Img & Cropper.ImgWithPreview for usage details\r
- * \r
- * Changelog:\r
- * v1.2.0 - 2006-10-30\r
- *             + Added id to the preview image element using 'imgCrop_[originalImageID]'\r
- *      * #00001 - Fixed bug: Doesn't account for scroll offsets\r
- *      * #00009 - Fixed bug: Placing the cropper inside differently positioned elements causes incorrect co-ordinates and display\r
- *      * #00013 - Fixed bug: I-bar cursor appears on drag plane\r
- *      * #00014 - Fixed bug: If ID for image tag is not found in document script throws error\r
- *      * Fixed bug with drag start co-ordinates if wrapper element has moved in browser (e.g. dragged to a new position)\r
- *      * Fixed bug with drag start co-ordinates if image contained in a wrapper with scrolling - this may be buggy if image \r
- *               has other ancestors with scrolling applied (except the body)\r
- *      * #00015 - Fixed bug: When cropper removed and then reapplied onEndCrop callback gets called multiple times, solution suggestion from Bill Smith\r
- *      * Various speed increases & code cleanup which meant improved performance in Mac - which allowed removal of different overlay methods for\r
- *        IE and all other browsers, which led to a fix for:\r
- *             * #00010 - Fixed bug: Select area doesn't adhere to image size when image resized using img attributes\r
- *      - #00006 - Removed default behaviour of automatically setting a ratio when both min width & height passed, the ratioDimensions must be passed in\r
- *             + #00005 - Added ability to set maximum crop dimensions, if both min & max set as the same value then we'll get a fixed cropper size on the axes as appropriate\r
- *        and the resize handles will not be displayed as appropriate\r
- *             * Switched keydown for keypress for moving select area with cursor keys (makes for nicer action) - doesn't appear to work in Safari\r
- * \r
- * v1.1.3 - 2006-08-21\r
- *             * Fixed wrong cursor on western handle in CSS\r
- *             + #00008 & #00003 - Added feature: Allow to set dimensions & position for cropper on load\r
- *      * #00002 - Fixed bug: Pressing 'remove cropper' twice removes image in IE\r
- * \r
- * v1.1.2 - 2006-06-09\r
- *             * Fixed bugs with ratios when GCD is low (patch submitted by Andy Skelton)\r
- * \r
- * v1.1.1 - 2006-06-03\r
- *             * Fixed bug with rendering issues fix in IE 5.5\r
- *             * Fixed bug with endCrop callback issues once cropper had been removed & reset in IE\r
- * \r
- * v1.1.0 - 2006-06-02\r
- *             * Fixed bug with IE constantly trying to reload select area background image\r
- *             * Applied more robust fix to Safari & IE rendering issues\r
- *             + Added method to reset parameters - useful for when dynamically changing img cropper attached to\r
- *             + Added method to remove cropper from image\r
- * \r
- * v1.0.0 - 2006-05-18 \r
- *             + Initial verison\r
- * \r
- * \r
- * Copyright (c) 2006, David Spurr (http://www.defusion.org.uk/)\r
- * All rights reserved.\r
- * \r
- * \r
- * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r
- * \r
- *     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
- *     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r
- *     * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\r
- * \r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- * \r
- * http://www.opensource.org/licenses/bsd-license.php\r
- * \r
- * See scriptaculous.js for full scriptaculous licence\r
- *\r
- * Modified 2013/06/01 Zach P to change $() to $PR() for eliminating conflicts with jQuery\r
- */\r
\r
-/**\r
- * Extend the Draggable class to allow us to pass the rendering\r
- * down to the Cropper object.\r
- */\r
-var CropDraggable = Class.create();\r
-\r
-Object.extend( Object.extend( CropDraggable.prototype, Draggable.prototype), {\r
-       \r
-       initialize: function(element) {\r
-               this.options = Object.extend(\r
-                       {\r
-                               /**\r
-                                * The draw method to defer drawing to\r
-                                */\r
-                               drawMethod: function() {}\r
-                       }, \r
-                       arguments[1] || {}\r
-               );\r
-\r
-               this.element = $PR(element);\r
-\r
-               this.handle = this.element;\r
-\r
-               this.delta    = this.currentDelta();\r
-               this.dragging = false;   \r
-\r
-               this.eventMouseDown = this.initDrag.bindAsEventListener(this);\r
-               Event.observe(this.handle, "mousedown", this.eventMouseDown);\r
-\r
-               Draggables.register(this);\r
-       },\r
-       \r
-       /**\r
-        * Defers the drawing of the draggable to the supplied method\r
-        */\r
-       draw: function(point) {\r
-               var pos = Position.cumulativeOffset(this.element);\r
-               var d = this.currentDelta();\r
-               pos[0] -= d[0]; \r
-               pos[1] -= d[1];\r
-                               \r
-               var p = [0,1].map(function(i) { \r
-                       return (point[i]-pos[i]-this.offset[i]) \r
-               }.bind(this));\r
-                               \r
-               this.options.drawMethod( p );\r
-       }\r
-       \r
-});\r
-\r
-\r
-/**\r
- * The Cropper object, this will attach itself to the provided image by wrapping it with \r
- * the generated xHTML structure required by the cropper.\r
- * \r
- * Usage:\r
- *     @param obj Image element to attach to\r
- *     @param obj Optional options:\r
- *             - ratioDim obj \r
- *                     The pixel dimensions to apply as a restrictive ratio, with properties x & y\r
- * \r
- *             - minWidth int \r
- *                     The minimum width for the select area in pixels\r
- * \r
- *             - minHeight     int \r
- *                     The mimimum height for the select area in pixels\r
- * \r
- *             - maxWidth int\r
- *                     The maximum width for the select areas in pixels (if both minWidth & maxWidth set to same the width of the cropper will be fixed)\r
- * \r
- *             - maxHeight int\r
- *                     The maximum height for the select areas in pixels (if both minHeight & maxHeight set to same the height of the cropper will be fixed)\r
- * \r
- *             - displayOnInit int \r
- *                     Whether to display the select area on initialisation, only used when providing minimum width & height or ratio\r
- * \r
- *             - onEndCrop func\r
- *                     The callback function to provide the crop details to on end of a crop (see below)\r
- * \r
- *             - captureKeys boolean\r
- *                     Whether to capture the keys for moving the select area, as these can cause some problems at the moment\r
- * \r
- *             - onloadCoords obj\r
- *                     A coordinates object with properties x1, y1, x2 & y2; for the coordinates of the select area to display onload\r
- *     \r
- *----------------------------------------------\r
- * \r
- * The callback function provided via the onEndCrop option should accept the following parameters:\r
- *             - coords obj\r
- *                     The coordinates object with properties x1, y1, x2 & y2; for the coordinates of the select area\r
- * \r
- *             - dimensions obj\r
- *                     The dimensions object with properites width & height; for the dimensions of the select area\r
- *             \r
- *\r
- *             Example:\r
- *                     function onEndCrop( coords, dimensions ) {\r
- *                             $PR( 'x1' ).value       = coords.x1;\r
- *                             $PR( 'y1' ).value       = coords.y1;\r
- *                             $PR( 'x2' ).value       = coords.x2;\r
- *                             $PR( 'y2' ).value       = coords.y2;\r
- *                             $PR( 'width' ).value    = dimensions.width;\r
- *                             $PR( 'height' ).value   = dimensions.height;\r
- *                     }\r
- * \r
- */\r
-var Cropper = {};\r
-Cropper.Img = Class.create();\r
-Cropper.Img.prototype = {\r
-       \r
-       /**\r
-        * Initialises the class\r
-        * \r
-        * @access public\r
-        * @param obj Image element to attach to\r
-        * @param obj Options\r
-        * @return void\r
-        */\r
-       initialize: function(element, options) {\r
-               this.options = Object.extend(\r
-                       {\r
-                               /**\r
-                                * @var obj\r
-                                * The pixel dimensions to apply as a restrictive ratio\r
-                                */\r
-                               ratioDim: { x: 0, y: 0 },\r
-                               /**\r
-                                * @var int\r
-                                * The minimum pixel width, also used as restrictive ratio if min height passed too\r
-                                */\r
-                               minWidth:               0,\r
-                               /**\r
-                                * @var int\r
-                                * The minimum pixel height, also used as restrictive ratio if min width passed too\r
-                                */\r
-                               minHeight:              0,\r
-                               /**\r
-                                * @var boolean\r
-                                * Whether to display the select area on initialisation, only used when providing minimum width & height or ratio\r
-                                */\r
-                               displayOnInit:  false,\r
-                               /**\r
-                                * @var function\r
-                                * The call back function to pass the final values to\r
-                                */\r
-                               onEndCrop: Prototype.emptyFunction,\r
-                               /**\r
-                                * @var boolean\r
-                                * Whether to capture key presses or not\r
-                                */\r
-                               captureKeys: true,\r
-                               /**\r
-                                * @var obj Coordinate object x1, y1, x2, y2\r
-                                * The coordinates to optionally display the select area at onload\r
-                                */\r
-                               onloadCoords: null,\r
-                               /**\r
-                                * @var int\r
-                                * The maximum width for the select areas in pixels (if both minWidth & maxWidth set to same the width of the cropper will be fixed)\r
-                                */\r
-                               maxWidth: 0,\r
-                               /**\r
-                                * @var int\r
-                                * The maximum height for the select areas in pixels (if both minHeight & maxHeight set to same the height of the cropper will be fixed)\r
-                                */\r
-                               maxHeight: 0\r
-                       }, \r
-                       options || {}\r
-               );                              \r
-               /**\r
-                * @var obj\r
-                * The img node to attach to\r
-                */\r
-               this.img                        = $PR( element );\r
-               /**\r
-                * @var obj\r
-                * The x & y coordinates of the click point\r
-                */\r
-               this.clickCoords        = { x: 0, y: 0 };\r
-               /**\r
-                * @var boolean\r
-                * Whether the user is dragging\r
-                */\r
-               this.dragging           = false;\r
-               /**\r
-                * @var boolean\r
-                * Whether the user is resizing\r
-                */\r
-               this.resizing           = false;\r
-               /**\r
-                * @var boolean\r
-                * Whether the user is on a webKit browser\r
-                */\r
-               this.isWebKit           = /Konqueror|Safari|KHTML/.test( navigator.userAgent );\r
-               /**\r
-                * @var boolean\r
-                * Whether the user is on IE\r
-                */\r
-               this.isIE                       = /MSIE/.test( navigator.userAgent );\r
-               /**\r
-                * @var boolean\r
-                * Whether the user is on Opera below version 9\r
-                */\r
-               this.isOpera8           = /Opera\s[1-8]/.test( navigator.userAgent );\r
-               /**\r
-                * @var int\r
-                * The x ratio \r
-                */\r
-               this.ratioX                     = 0;\r
-               /**\r
-                * @var int\r
-                * The y ratio\r
-                */\r
-               this.ratioY                     = 0;\r
-               /**\r
-                * @var boolean\r
-                * Whether we've attached sucessfully\r
-                */\r
-               this.attached           = false;\r
-               /**\r
-                * @var boolean\r
-                * Whether we've got a fixed width (if minWidth EQ or GT maxWidth then we have a fixed width\r
-                * in the case of minWidth > maxWidth maxWidth wins as the fixed width)\r
-                */\r
-               this.fixedWidth         = ( this.options.maxWidth > 0 && ( this.options.minWidth >= this.options.maxWidth ) );\r
-               /**\r
-                * @var boolean\r
-                * Whether we've got a fixed height (if minHeight EQ or GT maxHeight then we have a fixed height\r
-                * in the case of minHeight > maxHeight maxHeight wins as the fixed height)\r
-                */\r
-               this.fixedHeight        = ( this.options.maxHeight > 0 && ( this.options.minHeight >= this.options.maxHeight ) );\r
-               \r
-               // quit if the image element doesn't exist\r
-               if( typeof this.img == 'undefined' ) return;\r
-                               \r
-               // include the stylesheet               \r
-               $A( document.getElementsByTagName( 'script' ) ).each( \r
-                       function(s) {\r
-                               if( s.src.match( /cropper\.js/ ) ) {\r
-                                       var path        = s.src.replace( /cropper\.js(.*)?/, '' );\r
-                                       // '<link rel="stylesheet" type="text/css" href="' + path + 'cropper.css" media="screen" />';\r
-                                       var style               = document.createElement( 'link' );\r
-                                       style.rel               = 'stylesheet';\r
-                                       style.type              = 'text/css';\r
-                                       style.href              = path + 'cropper.css';\r
-                                       style.media     = 'screen';\r
-                                       document.getElementsByTagName( 'head' )[0].appendChild( style );\r
-                               }\r
-               }\r
-           );   \r
-       \r
-               // calculate the ratio when neccessary\r
-               if( this.options.ratioDim.x > 0 && this.options.ratioDim.y > 0 ) {\r
-                       var gcd = this.getGCD( this.options.ratioDim.x, this.options.ratioDim.y );\r
-                       this.ratioX = this.options.ratioDim.x / gcd;\r
-                       this.ratioY = this.options.ratioDim.y / gcd;\r
-                       // dump( 'RATIO : ' + this.ratioX + ':' + this.ratioY + '\n' );\r
-               }\r
-                                                       \r
-               // initialise sub classes\r
-               this.subInitialize();\r
-\r
-               // only load the event observers etc. once the image is loaded\r
-               // this is done after the subInitialize() call just in case the sub class does anything\r
-               // that will affect the result of the call to onLoad()\r
-               if( this.img.complete || this.isWebKit ) this.onLoad(); // for some reason Safari seems to support img.complete but returns 'undefined' on the this.img object\r
-               else Event.observe( this.img, 'load', this.onLoad.bindAsEventListener( this) );         \r
-       },\r
-       \r
-       /**\r
-        * The Euclidean algorithm used to find the greatest common divisor\r
-        * \r
-        * @acces private\r
-        * @param int Value 1\r
-        * @param int Value 2\r
-        * @return int\r
-        */\r
-       getGCD : function( a , b ) {\r
-               if( b == 0 ) return a;\r
-               return this.getGCD(b, a % b );\r
-       },\r
-       \r
-       /**\r
-        * Attaches the cropper to the image once it has loaded\r
-        * \r
-        * @access private\r
-        * @return void\r
-        */\r
-       onLoad: function( ) {\r
-               /*\r
-                * Build the container and all related elements, will result in the following\r
-                *\r
-                * <div class="imgCrop_wrap">\r
-                *              <img ... this.img ... />\r
-                *              <div class="imgCrop_dragArea">\r
-                *                      <!-- the inner spans are only required for IE to stop it making the divs 1px high/wide -->\r
-                *                      <div class="imgCrop_overlay imageCrop_north"><span></span></div>\r
-                *                      <div class="imgCrop_overlay imageCrop_east"><span></span></div>\r
-                *                      <div class="imgCrop_overlay imageCrop_south"><span></span></div>\r
-                *                      <div class="imgCrop_overlay imageCrop_west"><span></span></div>\r
-                *                      <div class="imgCrop_selArea">\r
-                *                              <!-- marquees -->\r
-                *                              <!-- the inner spans are only required for IE to stop it making the divs 1px high/wide -->\r
-                *                              <div class="imgCrop_marqueeHoriz imgCrop_marqueeNorth"><span></span></div>\r
-                *                              <div class="imgCrop_marqueeVert imgCrop_marqueeEast"><span></span></div>\r
-                *                              <div class="imgCrop_marqueeHoriz imgCrop_marqueeSouth"><span></span></div>\r
-                *                              <div class="imgCrop_marqueeVert imgCrop_marqueeWest"><span></span></div>                        \r
-                *                              <!-- handles -->\r
-                *                              <div class="imgCrop_handle imgCrop_handleN"></div>\r
-                *                              <div class="imgCrop_handle imgCrop_handleNE"></div>\r
-                *                              <div class="imgCrop_handle imgCrop_handleE"></div>\r
-                *                              <div class="imgCrop_handle imgCrop_handleSE"></div>\r
-                *                              <div class="imgCrop_handle imgCrop_handleS"></div>\r
-                *                              <div class="imgCrop_handle imgCrop_handleSW"></div>\r
-                *                              <div class="imgCrop_handle imgCrop_handleW"></div>\r
-                *                              <div class="imgCrop_handle imgCrop_handleNW"></div>\r
-                *                              <div class="imgCrop_clickArea"></div>\r
-                *                      </div>  \r
-                *                      <div class="imgCrop_clickArea"></div>\r
-                *              </div>  \r
-                * </div>\r
-                */\r
-               var cNamePrefix = 'imgCrop_';\r
-               \r
-               // get the point to insert the container\r
-               var insertPoint = this.img.parentNode;\r
-               \r
-               // apply an extra class to the wrapper to fix Opera below version 9\r
-               var fixOperaClass = '';\r
-               if( this.isOpera8 ) fixOperaClass = ' opera8';\r
-               this.imgWrap = Builder.node( 'div', { 'class': cNamePrefix + 'wrap' + fixOperaClass } );\r
-               \r
-               this.north              = Builder.node( 'div', { 'class': cNamePrefix + 'overlay ' + cNamePrefix + 'north' }, [Builder.node( 'span' )] );\r
-               this.east               = Builder.node( 'div', { 'class': cNamePrefix + 'overlay ' + cNamePrefix + 'east' } , [Builder.node( 'span' )] );\r
-               this.south              = Builder.node( 'div', { 'class': cNamePrefix + 'overlay ' + cNamePrefix + 'south' }, [Builder.node( 'span' )] );\r
-               this.west               = Builder.node( 'div', { 'class': cNamePrefix + 'overlay ' + cNamePrefix + 'west' } , [Builder.node( 'span' )] );\r
-               \r
-               var overlays    = [ this.north, this.east, this.south, this.west ];\r
-\r
-               this.dragArea   = Builder.node( 'div', { 'class': cNamePrefix + 'dragArea' }, overlays );\r
-                                               \r
-               this.handleN    = Builder.node( 'div', { 'class': cNamePrefix + 'handle ' + cNamePrefix + 'handleN' } );\r
-               this.handleNE   = Builder.node( 'div', { 'class': cNamePrefix + 'handle ' + cNamePrefix + 'handleNE' } );\r
-               this.handleE    = Builder.node( 'div', { 'class': cNamePrefix + 'handle ' + cNamePrefix + 'handleE' } );\r
-               this.handleSE   = Builder.node( 'div', { 'class': cNamePrefix + 'handle ' + cNamePrefix + 'handleSE' } );\r
-               this.handleS    = Builder.node( 'div', { 'class': cNamePrefix + 'handle ' + cNamePrefix + 'handleS' } );\r
-               this.handleSW   = Builder.node( 'div', { 'class': cNamePrefix + 'handle ' + cNamePrefix + 'handleSW' } );\r
-               this.handleW    = Builder.node( 'div', { 'class': cNamePrefix + 'handle ' + cNamePrefix + 'handleW' } );\r
-               this.handleNW   = Builder.node( 'div', { 'class': cNamePrefix + 'handle ' + cNamePrefix + 'handleNW' } );\r
-                               \r
-               this.selArea    = Builder.node( 'div', { 'class': cNamePrefix + 'selArea' },\r
-                       [\r
-                               Builder.node( 'div', { 'class': cNamePrefix + 'marqueeHoriz ' + cNamePrefix + 'marqueeNorth' }, [Builder.node( 'span' )] ),\r
-                               Builder.node( 'div', { 'class': cNamePrefix + 'marqueeVert ' + cNamePrefix + 'marqueeEast' }  , [Builder.node( 'span' )] ),\r
-                               Builder.node( 'div', { 'class': cNamePrefix + 'marqueeHoriz ' + cNamePrefix + 'marqueeSouth' }, [Builder.node( 'span' )] ),\r
-                               Builder.node( 'div', { 'class': cNamePrefix + 'marqueeVert ' + cNamePrefix + 'marqueeWest' }  , [Builder.node( 'span' )] ),\r
-                               this.handleN,\r
-                               this.handleNE,\r
-                               this.handleE,\r
-                               this.handleSE,\r
-                               this.handleS,\r
-                               this.handleSW,\r
-                               this.handleW,\r
-                               this.handleNW,\r
-                               Builder.node( 'div', { 'class': cNamePrefix + 'clickArea' } )\r
-                       ]\r
-               );\r
-                               \r
-               this.imgWrap.appendChild( this.img );\r
-               this.imgWrap.appendChild( this.dragArea );\r
-               this.dragArea.appendChild( this.selArea );\r
-               this.dragArea.appendChild( Builder.node( 'div', { 'class': cNamePrefix + 'clickArea' } ) );\r
-\r
-               insertPoint.appendChild( this.imgWrap );\r
-\r
-               // add event observers\r
-               this.startDragBind      = this.startDrag.bindAsEventListener( this );\r
-               Event.observe( this.dragArea, 'mousedown', this.startDragBind );\r
-               \r
-               this.onDragBind         = this.onDrag.bindAsEventListener( this );\r
-               Event.observe( document, 'mousemove', this.onDragBind );\r
-               \r
-               this.endCropBind        = this.endCrop.bindAsEventListener( this );\r
-               Event.observe( document, 'mouseup', this.endCropBind );\r
-               \r
-               this.resizeBind         = this.startResize.bindAsEventListener( this );\r
-               this.handles = [ this.handleN, this.handleNE, this.handleE, this.handleSE, this.handleS, this.handleSW, this.handleW, this.handleNW ];\r
-               this.registerHandles( true );\r
-               \r
-               if( this.options.captureKeys ) {\r
-                       this.keysBind = this.handleKeys.bindAsEventListener( this );\r
-                       Event.observe( document, 'keypress', this.keysBind );\r
-               }\r
-\r
-               // attach the dragable to the select area\r
-               new CropDraggable( this.selArea, { drawMethod: this.moveArea.bindAsEventListener( this ) } );\r
-               \r
-               this.setParams();\r
-       },\r
-       \r
-       /**\r
-        * Manages adding or removing the handle event handler and hiding or displaying them as appropriate\r
-        * \r
-        * @access private\r
-        * @param boolean registration true = add, false = remove\r
-        * @return void\r
-        */\r
-       registerHandles: function( registration ) {     \r
-               for( var i = 0; i < this.handles.length; i++ ) {\r
-                       var handle = $PR( this.handles[i] );\r
-                       \r
-                       if( registration ) {\r
-                               var hideHandle  = false;        // whether to hide the handle\r
-                               \r
-                               // disable handles asappropriate if we've got fixed dimensions\r
-                               // if both dimensions are fixed we don't need to do much\r
-                               if( this.fixedWidth && this.fixedHeight ) hideHandle = true;\r
-                               else if( this.fixedWidth || this.fixedHeight ) {\r
-                                       // if one of the dimensions is fixed then just hide those handles\r
-                                       var isCornerHandle      = handle.className.match( /([S|N][E|W])$/ )\r
-                                       var isWidthHandle       = handle.className.match( /(E|W)$/ );\r
-                                       var isHeightHandle      = handle.className.match( /(N|S)$/ );\r
-                                       if( isCornerHandle ) hideHandle = true;\r
-                                       else if( this.fixedWidth && isWidthHandle ) hideHandle = true;\r
-                                       else if( this.fixedHeight && isHeightHandle ) hideHandle = true;\r
-                               }\r
-                               if( hideHandle ) handle.hide();\r
-                               else Event.observe( handle, 'mousedown', this.resizeBind );\r
-                       } else {\r
-                               handle.show();\r
-                               Event.stopObserving( handle, 'mousedown', this.resizeBind );\r
-                       }\r
-               }\r
-       },\r
-               \r
-       /**\r
-        * Sets up all the cropper parameters, this can be used to reset the cropper when dynamically\r
-        * changing the images\r
-        * \r
-        * @access private\r
-        * @return void\r
-        */\r
-       setParams: function() {\r
-               /**\r
-                * @var int\r
-                * The image width\r
-                */\r
-               this.imgW = this.img.width;\r
-               /**\r
-                * @var int\r
-                * The image height\r
-                */\r
-               this.imgH = this.img.height;                    \r
-\r
-               $PR( this.north ).setStyle( { height: 0 } );\r
-               $PR( this.east ).setStyle( { width: 0, height: 0 } );\r
-               $PR( this.south ).setStyle( { height: 0 } );\r
-               $PR( this.west ).setStyle( { width: 0, height: 0 } );\r
-               \r
-               // resize the container to fit the image\r
-               $PR( this.imgWrap ).setStyle( { 'width': this.imgW + 'px', 'height': this.imgH + 'px' } );\r
-               \r
-               // hide the select area\r
-               $PR( this.selArea ).hide();\r
-                                               \r
-               // setup the starting position of the select area\r
-               var startCoords = { x1: 0, y1: 0, x2: 0, y2: 0 };\r
-               var validCoordsSet = false;\r
-               \r
-               // display the select area \r
-               if( this.options.onloadCoords != null ) {\r
-                       // if we've being given some coordinates to \r
-                       startCoords = this.cloneCoords( this.options.onloadCoords );\r
-                       validCoordsSet = true;\r
-               } else if( this.options.ratioDim.x > 0 && this.options.ratioDim.y > 0 ) {\r
-                       // if there is a ratio limit applied and the then set it to initial ratio\r
-                       startCoords.x1 = Math.ceil( ( this.imgW - this.options.ratioDim.x ) / 2 );\r
-                       startCoords.y1 = Math.ceil( ( this.imgH - this.options.ratioDim.y ) / 2 );\r
-                       startCoords.x2 = startCoords.x1 + this.options.ratioDim.x;\r
-                       startCoords.y2 = startCoords.y1 + this.options.ratioDim.y;\r
-                       validCoordsSet = true;\r
-               }\r
-               \r
-               this.setAreaCoords( startCoords, false, false, 1 );\r
-               \r
-               if( this.options.displayOnInit && validCoordsSet ) {\r
-                       this.selArea.show();\r
-                       this.drawArea();\r
-                       this.endCrop();\r
-               }\r
-               \r
-               this.attached = true;\r
-       },\r
-       \r
-       /**\r
-        * Removes the cropper\r
-        * \r
-        * @access public\r
-        * @return void\r
-        */\r
-       remove: function() {\r
-               if( this.attached ) {\r
-                       this.attached = false;\r
-                       \r
-                       // remove the elements we inserted\r
-                       this.imgWrap.parentNode.insertBefore( this.img, this.imgWrap );\r
-                       this.imgWrap.parentNode.removeChild( this.imgWrap );\r
-                       \r
-                       // remove the event observers\r
-                       Event.stopObserving( this.dragArea, 'mousedown', this.startDragBind );\r
-                       Event.stopObserving( document, 'mousemove', this.onDragBind );          \r
-                       Event.stopObserving( document, 'mouseup', this.endCropBind );\r
-                       this.registerHandles( false );\r
-                       if( this.options.captureKeys ) Event.stopObserving( document, 'keypress', this.keysBind );\r
-               }\r
-       },\r
-       \r
-       /**\r
-        * Resets the cropper, can be used either after being removed or any time you wish\r
-        * \r
-        * @access public\r
-        * @return void\r
-        */\r
-       reset: function() {\r
-               if( !this.attached ) this.onLoad();\r
-               else this.setParams();\r
-               this.endCrop();\r
-       },\r
-       \r
-       /**\r
-        * Handles the key functionality, currently just using arrow keys to move, if the user\r
-        * presses shift then the area will move by 10 pixels\r
-        */\r
-       handleKeys: function( e ) {\r
-               var dir = { x: 0, y: 0 }; // direction to move it in & the amount in pixels\r
-               if( !this.dragging ) {\r
-                       \r
-                       // catch the arrow keys\r
-                       switch( e.keyCode ) {\r
-                               case( 37 ) : // left\r
-                                       dir.x = -1;\r
-                                       break;\r
-                               case( 38 ) : // up\r
-                                       dir.y = -1;\r
-                                       break;\r
-                               case( 39 ) : // right\r
-                                       dir.x = 1;\r
-                                       break\r
-                               case( 40 ) : // down\r
-                                       dir.y = 1;\r
-                                       break;\r
-                       }\r
-                       \r
-                       if( dir.x != 0 || dir.y != 0 ) {\r
-                               // if shift is pressed then move by 10 pixels\r
-                               if( e.shiftKey ) {\r
-                                       dir.x *= 10;\r
-                                       dir.y *= 10;\r
-                               }\r
-                               \r
-                               this.moveArea( [ this.areaCoords.x1 + dir.x, this.areaCoords.y1 + dir.y ] );\r
-                               Event.stop( e ); \r
-                       }\r
-               }\r
-       },\r
-       \r
-       /**\r
-        * Calculates the width from the areaCoords\r
-        * \r
-        * @access private\r
-        * @return int\r
-        */\r
-       calcW: function() {\r
-               return (this.areaCoords.x2 - this.areaCoords.x1)\r
-       },\r
-       \r
-       /**\r
-        * Calculates the height from the areaCoords\r
-        * \r
-        * @access private\r
-        * @return int\r
-        */\r
-       calcH: function() {\r
-               return (this.areaCoords.y2 - this.areaCoords.y1)\r
-       },\r
-       \r
-       /**\r
-        * Moves the select area to the supplied point (assumes the point is x1 & y1 of the select area)\r
-        * \r
-        * @access public\r
-        * @param array Point for x1 & y1 to move select area to\r
-        * @return void\r
-        */\r
-       moveArea: function( point ) {\r
-               // dump( 'moveArea        : ' + point[0] + ',' + point[1] + ',' + ( point[0] + ( this.areaCoords.x2 - this.areaCoords.x1 ) ) + ',' + ( point[1] + ( this.areaCoords.y2 - this.areaCoords.y1 ) ) + '\n' );\r
-               this.setAreaCoords( \r
-                       {\r
-                               x1: point[0], \r
-                               y1: point[1],\r
-                               x2: point[0] + this.calcW(),\r
-                               y2: point[1] + this.calcH()\r
-                       },\r
-                       true,\r
-                       false\r
-               );\r
-               this.drawArea();\r
-       },\r
-\r
-       /**\r
-        * Clones a co-ordinates object, stops problems with handling them by reference\r
-        * \r
-        * @access private\r
-        * @param obj Coordinate object x1, y1, x2, y2\r
-        * @return obj Coordinate object x1, y1, x2, y2\r
-        */\r
-       cloneCoords: function( coords ) {\r
-               return { x1: coords.x1, y1: coords.y1, x2: coords.x2, y2: coords.y2 };\r
-       },\r
-\r
-       /**\r
-        * Sets the select coords to those provided but ensures they don't go\r
-        * outside the bounding box\r
-        * \r
-        * @access private\r
-        * @param obj Coordinates x1, y1, x2, y2\r
-        * @param boolean Whether this is a move\r
-        * @param boolean Whether to apply squaring\r
-        * @param obj Direction of mouse along both axis x, y ( -1 = negative, 1 = positive ) only required when moving etc.\r
-        * @param string The current resize handle || null\r
-        * @return void\r
-        */\r
-       setAreaCoords: function( coords, moving, square, direction, resizeHandle ) {\r
-               // dump( 'setAreaCoords (in) : ' + coords.x1 + ',' + coords.y1 + ',' + coords.x2 + ',' + coords.y2 );\r
-               if( moving ) {\r
-                       // if moving\r
-                       var targW = coords.x2 - coords.x1;\r
-                       var targH = coords.y2 - coords.y1;\r
-                       \r
-                       // ensure we're within the bounds\r
-                       if( coords.x1 < 0 ) {\r
-                               coords.x1 = 0;\r
-                               coords.x2 = targW;\r
-                       }\r
-                       if( coords.y1 < 0 ) {\r
-                               coords.y1 = 0;\r
-                               coords.y2 = targH;\r
-                       }\r
-                       if( coords.x2 > this.imgW ) {\r
-                               coords.x2 = this.imgW;\r
-                               coords.x1 = this.imgW - targW;\r
-                       }\r
-                       if( coords.y2 > this.imgH ) {\r
-                               coords.y2 = this.imgH;\r
-                               coords.y1 = this.imgH - targH;\r
-                       }                       \r
-               } else {\r
-                       // ensure we're within the bounds\r
-                       if( coords.x1 < 0 ) coords.x1 = 0;\r
-                       if( coords.y1 < 0 ) coords.y1 = 0;\r
-                       if( coords.x2 > this.imgW ) coords.x2 = this.imgW;\r
-                       if( coords.y2 > this.imgH ) coords.y2 = this.imgH;\r
-                       \r
-                       // This is passed as null in onload\r
-                       if( direction != null ) {\r
-                                                               \r
-                               // apply the ratio or squaring where appropriate\r
-                               if( this.ratioX > 0 ) this.applyRatio( coords, { x: this.ratioX, y: this.ratioY }, direction, resizeHandle );\r
-                               else if( square ) this.applyRatio( coords, { x: 1, y: 1 }, direction, resizeHandle );\r
-                                                                               \r
-                               var mins = [ this.options.minWidth, this.options.minHeight ]; // minimum dimensions [x,y]                       \r
-                               var maxs = [ this.options.maxWidth, this.options.maxHeight ]; // maximum dimensions [x,y]\r
-               \r
-                               // apply dimensions where appropriate\r
-                               if( mins[0] > 0 || mins[1] > 0 || maxs[0] > 0 || maxs[1] > 0) {\r
-                               \r
-                                       var coordsTransX        = { a1: coords.x1, a2: coords.x2 };\r
-                                       var coordsTransY        = { a1: coords.y1, a2: coords.y2 };\r
-                                       var boundsX                     = { min: 0, max: this.imgW };\r
-                                       var boundsY                     = { min: 0, max: this.imgH };\r
-                                       \r
-                                       // handle squaring properly on single axis minimum dimensions\r
-                                       if( (mins[0] != 0 || mins[1] != 0) && square ) {\r
-                                               if( mins[0] > 0 ) mins[1] = mins[0];\r
-                                               else if( mins[1] > 0 ) mins[0] = mins[1];\r
-                                       }\r
-                                       \r
-                                       if( (maxs[0] != 0 || maxs[0] != 0) && square ) {\r
-                                               // if we have a max x value & it is less than the max y value then we set the y max to the max x (so we don't go over the minimum maximum of one of the axes - if that makes sense)\r
-                                               if( maxs[0] > 0 && maxs[0] <= maxs[1] ) maxs[1] = maxs[0];\r
-                                               else if( maxs[1] > 0 && maxs[1] <= maxs[0] ) maxs[0] = maxs[1];\r
-                                       }\r
-                                       \r
-                                       if( mins[0] > 0 ) this.applyDimRestriction( coordsTransX, mins[0], direction.x, boundsX, 'min' );\r
-                                       if( mins[1] > 1 ) this.applyDimRestriction( coordsTransY, mins[1], direction.y, boundsY, 'min' );\r
-                                       \r
-                                       if( maxs[0] > 0 ) this.applyDimRestriction( coordsTransX, maxs[0], direction.x, boundsX, 'max' );\r
-                                       if( maxs[1] > 1 ) this.applyDimRestriction( coordsTransY, maxs[1], direction.y, boundsY, 'max' );\r
-                                       \r
-                                       coords = { x1: coordsTransX.a1, y1: coordsTransY.a1, x2: coordsTransX.a2, y2: coordsTransY.a2 };\r
-                               }\r
-                               \r
-                       }\r
-               }\r
-               \r
-               // dump( 'setAreaCoords (out) : ' + coords.x1 + ',' + coords.y1 + ',' + coords.x2 + ',' + coords.y2 + '\n' );\r
-               this.areaCoords = coords;\r
-       },\r
-       \r
-       /**\r
-        * Applies the supplied dimension restriction to the supplied coordinates along a single axis\r
-        * \r
-        * @access private\r
-        * @param obj Single axis coordinates, a1, a2 (e.g. for the x axis a1 = x1 & a2 = x2)\r
-        * @param int The restriction value\r
-        * @param int The direction ( -1 = negative, 1 = positive )\r
-        * @param obj The bounds of the image ( for this axis )\r
-        * @param string The dimension restriction type ( 'min' | 'max' )\r
-        * @return void\r
-        */\r
-       applyDimRestriction: function( coords, val, direction, bounds, type ) {\r
-               var check;\r
-               if( type == 'min' ) check = ( ( coords.a2 - coords.a1 ) < val );\r
-               else check = ( ( coords.a2 - coords.a1 ) > val );\r
-               if( check ) {\r
-                       if( direction == 1 ) coords.a2 = coords.a1 + val;\r
-                       else coords.a1 = coords.a2 - val;\r
-                       \r
-                       // make sure we're still in the bounds (not too pretty for the user, but needed)\r
-                       if( coords.a1 < bounds.min ) {\r
-                               coords.a1 = bounds.min;\r
-                               coords.a2 = val;\r
-                       } else if( coords.a2 > bounds.max ) {\r
-                               coords.a1 = bounds.max - val;\r
-                               coords.a2 = bounds.max;\r
-                       }\r
-               }\r
-       },\r
-               \r
-       /**\r
-        * Applies the supplied ratio to the supplied coordinates\r
-        * \r
-        * @access private\r
-        * @param obj Coordinates, x1, y1, x2, y2\r
-        * @param obj Ratio, x, y\r
-        * @param obj Direction of mouse, x & y : -1 == negative 1 == positive\r
-        * @param string The current resize handle || null\r
-        * @return void\r
-        */\r
-       applyRatio : function( coords, ratio, direction, resizeHandle ) {\r
-               // dump( 'direction.y : ' + direction.y + '\n');\r
-               var newCoords;\r
-               if( resizeHandle == 'N' || resizeHandle == 'S' ) {\r
-                       // dump( 'north south \n');\r
-                       // if moving on either the lone north & south handles apply the ratio on the y axis\r
-                       newCoords = this.applyRatioToAxis( \r
-                               { a1: coords.y1, b1: coords.x1, a2: coords.y2, b2: coords.x2 },\r
-                               { a: ratio.y, b: ratio.x },\r
-                               { a: direction.y, b: direction.x },\r
-                               { min: 0, max: this.imgW }\r
-                       );\r
-                       coords.x1 = newCoords.b1;\r
-                       coords.y1 = newCoords.a1;\r
-                       coords.x2 = newCoords.b2;\r
-                       coords.y2 = newCoords.a2;\r
-               } else {\r
-                       // otherwise deal with it as if we're applying the ratio on the x axis\r
-                       newCoords = this.applyRatioToAxis( \r
-                               { a1: coords.x1, b1: coords.y1, a2: coords.x2, b2: coords.y2 },\r
-                               { a: ratio.x, b: ratio.y },\r
-                               { a: direction.x, b: direction.y },\r
-                               { min: 0, max: this.imgH }\r
-                       );\r
-                       coords.x1 = newCoords.a1;\r
-                       coords.y1 = newCoords.b1;\r
-                       coords.x2 = newCoords.a2;\r
-                       coords.y2 = newCoords.b2;\r
-               }\r
-               \r
-       },\r
-       \r
-       /**\r
-        * Applies the provided ratio to the provided coordinates based on provided direction & bounds,\r
-        * use to encapsulate functionality to make it easy to apply to either axis. This is probably\r
-        * quite hard to visualise so see the x axis example within applyRatio()\r
-        * \r
-        * Example in parameter details & comments is for requesting applying ratio to x axis.\r
-        * \r
-        * @access private\r
-        * @param obj Coords object (a1, b1, a2, b2) where a = x & b = y in example\r
-        * @param obj Ratio object (a, b) where a = x & b = y in example\r
-        * @param obj Direction object (a, b) where a = x & b = y in example\r
-        * @param obj Bounds (min, max)\r
-        * @return obj Coords object (a1, b1, a2, b2) where a = x & b = y in example\r
-        */\r
-       applyRatioToAxis: function( coords, ratio, direction, bounds ) {\r
-               var newCoords = Object.extend( coords, {} );\r
-               var calcDimA = newCoords.a2 - newCoords.a1;                     // calculate dimension a (e.g. width)\r
-               var targDimB = Math.floor( calcDimA * ratio.b / ratio.a );      // the target dimension b (e.g. height)\r
-               var targB;                                                                                      // to hold target b (e.g. y value)\r
-               var targDimA;                                           // to hold target dimension a (e.g. width)\r
-               var calcDimB = null;                                                            // to hold calculated dimension b (e.g. height)\r
-               \r
-               // dump( 'newCoords[0]: ' + newCoords.a1 + ',' + newCoords.b1 + ','+ newCoords.a2 + ',' + newCoords.b2 + '\n');\r
-                               \r
-               if( direction.b == 1 ) {                                                        // if travelling in a positive direction\r
-                       // make sure we're not going out of bounds\r
-                       targB = newCoords.b1 + targDimB;\r
-                       if( targB > bounds.max ) {\r
-                               targB = bounds.max;\r
-                               calcDimB = targB - newCoords.b1;                        // calcuate dimension b (e.g. height)\r
-                       }\r
-                       \r
-                       newCoords.b2 = targB;\r
-               } else {                                                                                        // if travelling in a negative direction\r
-                       // make sure we're not going out of bounds\r
-                       targB = newCoords.b2 - targDimB;\r
-                       if( targB < bounds.min ) {\r
-                               targB = bounds.min;\r
-                               calcDimB = targB + newCoords.b2;                        // calcuate dimension b (e.g. height)\r
-                       }\r
-                       newCoords.b1 = targB;\r
-               }\r
-               \r
-               // dump( 'newCoords[1]: ' + newCoords.a1 + ',' + newCoords.b1 + ','+ newCoords.a2 + ',' + newCoords.b2 + '\n');\r
-                       \r
-               // apply the calculated dimensions\r
-               if( calcDimB != null ) {\r
-                       targDimA = Math.floor( calcDimB * ratio.a / ratio.b );\r
-                       \r
-                       if( direction.a == 1 ) newCoords.a2 = newCoords.a1 + targDimA;\r
-                       else newCoords.a1 = newCoords.a1 = newCoords.a2 - targDimA;\r
-               }\r
-               \r
-               // dump( 'newCoords[2]: ' + newCoords.a1 + ',' + newCoords.b1 + ','+ newCoords.a2 + ',' + newCoords.b2 + '\n');\r
-                       \r
-               return newCoords;\r
-       },\r
-       \r
-       /**\r
-        * Draws the select area\r
-        * \r
-        * @access private\r
-        * @return void\r
-        */\r
-       drawArea: function( ) { \r
-               /*\r
-                * NOTE: I'm not using the Element.setStyle() shortcut as they make it \r
-                * quite sluggish on Mac based browsers\r
-                */\r
-               // dump( 'drawArea        : ' + this.areaCoords.x1 + ',' + this.areaCoords.y1 + ',' + this.areaCoords.x2 + ',' + this.areaCoords.y2 + '\n' );\r
-               var areaWidth     = this.calcW();\r
-               var areaHeight    = this.calcH();\r
-               \r
-               /*\r
-                * Calculate all the style strings before we use them, allows reuse & produces quicker\r
-                * rendering (especially noticable in Mac based browsers)\r
-                */\r
-               var px = 'px';\r
-               var params = [\r
-                       this.areaCoords.x1 + px,        // the left of the selArea\r
-                       this.areaCoords.y1 + px,                // the top of the selArea\r
-                       areaWidth + px,                                 // width of the selArea\r
-                       areaHeight + px,                                        // height of the selArea\r
-                       this.areaCoords.x2 + px,                // bottom of the selArea\r
-                       this.areaCoords.y2 + px,                // right of the selArea\r
-                       (this.img.width - this.areaCoords.x2) + px,     // right edge of selArea\r
-                       (this.img.height - this.areaCoords.y2) + px     // bottom edge of selArea\r
-               ];\r
-                               \r
-               // do the select area\r
-               var areaStyle                           = this.selArea.style;\r
-               areaStyle.left                          = params[0];\r
-               areaStyle.top                           = params[1];\r
-               areaStyle.width                         = params[2];\r
-               areaStyle.height                        = params[3];\r
-                               \r
-               // position the north, east, south & west handles\r
-               var horizHandlePos = Math.ceil( (areaWidth - 6) / 2 ) + px;\r
-               var vertHandlePos = Math.ceil( (areaHeight - 6) / 2 ) + px;\r
-               \r
-               this.handleN.style.left         = horizHandlePos;\r
-               this.handleE.style.top          = vertHandlePos;\r
-               this.handleS.style.left         = horizHandlePos;\r
-               this.handleW.style.top          = vertHandlePos;\r
-               \r
-               // draw the four overlays\r
-               this.north.style.height         = params[1];\r
-               \r
-               var eastStyle                           = this.east.style;\r
-               eastStyle.top                           = params[1];\r
-               eastStyle.height                        = params[3];\r
-               eastStyle.left                          = params[4];\r
-           eastStyle.width                             = params[6];\r
-          \r
-               var southStyle                          = this.south.style;\r
-               southStyle.top                          = params[5];\r
-               southStyle.height                       = params[7];\r
-          \r
-           var westStyle                       = this.west.style;\r
-           westStyle.top                               = params[1];\r
-           westStyle.height                    = params[3];\r
-               westStyle.width                         = params[0];\r
-               \r
-               // call the draw method on sub classes\r
-               this.subDrawArea();\r
-               \r
-               this.forceReRender();\r
-       },\r
-       \r
-       /**\r
-        * Force the re-rendering of the selArea element which fixes rendering issues in Safari \r
-        * & IE PC, especially evident when re-sizing perfectly vertical using any of the south handles\r
-        * \r
-        * @access private\r
-        * @return void\r
-        */\r
-       forceReRender: function() {\r
-               if( this.isIE || this.isWebKit) {\r
-                       var n = document.createTextNode(' ');\r
-                       var d,el,fixEL,i;\r
-               \r
-                       if( this.isIE ) fixEl = this.selArea;\r
-                       else if( this.isWebKit ) {\r
-                               fixEl = document.getElementsByClassName( 'imgCrop_marqueeSouth', this.imgWrap )[0];\r
-                               /* we have to be a bit more forceful for Safari, otherwise the the marquee &\r
-                                * the south handles still don't move\r
-                                */ \r
-                               d = Builder.node( 'div', '' );\r
-                               d.style.visibility = 'hidden';\r
-                               \r
-                               var classList = ['SE','S','SW'];\r
-                               for( i = 0; i < classList.length; i++ ) {\r
-                                       el = document.getElementsByClassName( 'imgCrop_handle' + classList[i], this.selArea )[0];\r
-                                       if( el.childNodes.length ) el.removeChild( el.childNodes[0] );\r
-                                       el.appendChild(d);\r
-                               }\r
-                       }\r
-                       fixEl.appendChild(n);\r
-                       fixEl.removeChild(n);\r
-               }\r
-       },\r
-       \r
-       /**\r
-        * Starts the resize\r
-        * \r
-        * @access private\r
-        * @param obj Event\r
-        * @return void\r
-        */\r
-       startResize: function( e ) {\r
-               this.startCoords = this.cloneCoords( this.areaCoords );\r
-               \r
-               this.resizing = true;\r
-               this.resizeHandle = Event.element( e ).classNames().toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/, '');\r
-               // dump( 'this.resizeHandle : ' + this.resizeHandle + '\n' );\r
-               Event.stop( e );\r
-       },\r
-       \r
-       /**\r
-        * Starts the drag\r
-        * \r
-        * @access private\r
-        * @param obj Event\r
-        * @return void\r
-        */\r
-       startDrag: function( e ) {      \r
-               this.selArea.show();\r
-               this.clickCoords = this.getCurPos( e );\r
-       \r
-       this.setAreaCoords( { x1: this.clickCoords.x, y1: this.clickCoords.y, x2: this.clickCoords.x, y2: this.clickCoords.y }, false, false, null );\r
-       \r
-       this.dragging = true;\r
-       this.onDrag( e ); // incase the user just clicks once after already making a selection\r
-       Event.stop( e );\r
-       },\r
-       \r
-       /**\r
-        * Gets the current cursor position relative to the image\r
-        * \r
-        * @access private\r
-        * @param obj Event\r
-        * @return obj x,y pixels of the cursor\r
-        */\r
-       getCurPos: function( e ) {\r
-               // get the offsets for the wrapper within the document\r
-               var el = this.imgWrap, wrapOffsets = Position.cumulativeOffset( el );\r
-               // remove any scrolling that is applied to the wrapper (this may be buggy) - don't count the scroll on the body as that won't affect us\r
-               while( el.nodeName != 'BODY' ) {\r
-                       wrapOffsets[1] -= el.scrollTop  || 0;\r
-                       wrapOffsets[0] -= el.scrollLeft || 0;\r
-                       el = el.parentNode;\r
-           }           \r
-               return curPos = { \r
-                       x: Event.pointerX(e) - wrapOffsets[0],\r
-                       y: Event.pointerY(e) - wrapOffsets[1]\r
-               }\r
-       },\r
-       \r
-       /**\r
-        * Performs the drag for both resize & inital draw dragging\r
-        * \r
-        * @access private\r
-        * @param obj Event\r
-        * @return void\r
-        */\r
-       onDrag: function( e ) {\r
-               if( this.dragging || this.resizing ) {  \r
-               \r
-                       var resizeHandle = null;\r
-                       var curPos = this.getCurPos( e );                       \r
-                       var newCoords = this.cloneCoords( this.areaCoords );\r
-                       var direction = { x: 1, y: 1 };\r
-                                               \r
-                   if( this.dragging ) {\r
-                       if( curPos.x < this.clickCoords.x ) direction.x = -1;\r
-                       if( curPos.y < this.clickCoords.y ) direction.y = -1;\r
-                       \r
-                               this.transformCoords( curPos.x, this.clickCoords.x, newCoords, 'x' );\r
-                               this.transformCoords( curPos.y, this.clickCoords.y, newCoords, 'y' );\r
-                       } else if( this.resizing ) {\r
-                               resizeHandle = this.resizeHandle;                       \r
-                               // do x movements first\r
-                               if( resizeHandle.match(/E/) ) {\r
-                                       // if we're moving an east handle\r
-                                       this.transformCoords( curPos.x, this.startCoords.x1, newCoords, 'x' );  \r
-                                       if( curPos.x < this.startCoords.x1 ) direction.x = -1;\r
-                               } else if( resizeHandle.match(/W/) ) {\r
-                                       // if we're moving an west handle\r
-                                       this.transformCoords( curPos.x, this.startCoords.x2, newCoords, 'x' );\r
-                                       if( curPos.x < this.startCoords.x2 ) direction.x = -1;\r
-                               }\r
-                                                                       \r
-                               // do y movements second\r
-                               if( resizeHandle.match(/N/) ) {\r
-                                       // if we're moving an north handle      \r
-                                       this.transformCoords( curPos.y, this.startCoords.y2, newCoords, 'y' );\r
-                                       if( curPos.y < this.startCoords.y2 ) direction.y = -1;\r
-                               } else if( resizeHandle.match(/S/) ) {\r
-                                       // if we're moving an south handle\r
-                                       this.transformCoords( curPos.y, this.startCoords.y1, newCoords, 'y' );  \r
-                                       if( curPos.y < this.startCoords.y1 ) direction.y = -1;\r
-                               }       \r
-                                                       \r
-                       }\r
-               \r
-                       this.setAreaCoords( newCoords, false, e.shiftKey, direction, resizeHandle );\r
-                       this.drawArea();\r
-                       Event.stop( e ); // stop the default event (selecting images & text) in Safari & IE PC\r
-               }\r
-       },\r
-       \r
-       /**\r
-        * Applies the appropriate transform to supplied co-ordinates, on the\r
-        * defined axis, depending on the relationship of the supplied values\r
-        * \r
-        * @access private\r
-        * @param int Current value of pointer\r
-        * @param int Base value to compare current pointer val to\r
-        * @param obj Coordinates to apply transformation on x1, x2, y1, y2\r
-        * @param string Axis to apply transformation on 'x' || 'y'\r
-        * @return void\r
-        */\r
-       transformCoords : function( curVal, baseVal, coords, axis ) {\r
-               var newVals = [ curVal, baseVal ];\r
-               if( curVal > baseVal ) newVals.reverse();\r
-               coords[ axis + '1' ] = newVals[0];\r
-               coords[ axis + '2' ] = newVals[1];              \r
-       },\r
-       \r
-       /**\r
-        * Ends the crop & passes the values of the select area on to the appropriate \r
-        * callback function on completion of a crop\r
-        * \r
-        * @access private\r
-        * @return void\r
-        */\r
-       endCrop : function() {\r
-               this.dragging = false;\r
-               this.resizing = false;\r
-               \r
-               this.options.onEndCrop(\r
-                       this.areaCoords,\r
-                       {\r
-                               width: this.calcW(), \r
-                               height: this.calcH() \r
-                       }\r
-               );\r
-       },\r
-       \r
-       /**\r
-        * Abstract method called on the end of initialization\r
-        * \r
-        * @access private\r
-        * @abstract\r
-        * @return void\r
-        */\r
-       subInitialize: function() {},\r
-       \r
-       /**\r
-        * Abstract method called on the end of drawArea()\r
-        * \r
-        * @access private\r
-        * @abstract\r
-        * @return void\r
-        */\r
-       subDrawArea: function() {}\r
-};\r
-\r
-\r
-\r
-\r
-/**\r
- * Extend the Cropper.Img class to allow for presentation of a preview image of the resulting crop,\r
- * the option for displayOnInit is always overridden to true when displaying a preview image\r
- * \r
- * Usage:\r
- *     @param obj Image element to attach to\r
- *     @param obj Optional options:\r
- *             - see Cropper.Img for base options\r
- *             \r
- *             - previewWrap obj\r
- *                     HTML element that will be used as a container for the preview image             \r
- */\r
-Cropper.ImgWithPreview = Class.create();\r
-\r
-Object.extend( Object.extend( Cropper.ImgWithPreview.prototype, Cropper.Img.prototype ), {\r
-       \r
-       /**\r
-        * Implements the abstract method from Cropper.Img to initialize preview image settings.\r
-        * Will only attach a preview image is the previewWrap element is defined and the minWidth\r
-        * & minHeight options are set.\r
-        * \r
-        * @see Croper.Img.subInitialize\r
-        */\r
-       subInitialize: function() {\r
-               /**\r
-                * Whether or not we've attached a preview image\r
-                * @var boolean\r
-                */\r
-               this.hasPreviewImg = false;\r
-               if( typeof(this.options.previewWrap) != 'undefined' \r
-                       && this.options.minWidth > 0 \r
-                       && this.options.minHeight > 0\r
-               ) {\r
-                       /**\r
-                        * The preview image wrapper element\r
-                        * @var obj HTML element\r
-                        */\r
-                       this.previewWrap        = $PR( this.options.previewWrap );\r
-                       /**\r
-                        * The preview image element\r
-                        * @var obj HTML IMG element\r
-                        */\r
-                       this.previewImg         = this.img.cloneNode( false );\r
-                       // set the ID of the preview image to be unique\r
-                       this.previewImg.id      = 'imgCrop_' + this.previewImg.id;\r
-                       \r
-                                               \r
-                       // set the displayOnInit option to true so we display the select area at the same time as the thumbnail\r
-                       this.options.displayOnInit = true;\r
-\r
-                       this.hasPreviewImg      = true;\r
-                       \r
-                       this.previewWrap.addClassName( 'imgCrop_previewWrap' );\r
-                       \r
-                       this.previewWrap.setStyle(\r
-                        { \r
-                               width: this.options.minWidth + 'px',\r
-                               height: this.options.minHeight + 'px'\r
-                        }\r
-                       );\r
-                       \r
-                       this.previewWrap.appendChild( this.previewImg );\r
-               }\r
-       },\r
-       \r
-       /**\r
-        * Implements the abstract method from Cropper.Img to draw the preview image\r
-        * \r
-        * @see Croper.Img.subDrawArea\r
-        */\r
-       subDrawArea: function() {\r
-               if( this.hasPreviewImg ) {\r
-                       // get the ratio of the select area to the src image\r
-                       var calcWidth = this.calcW();\r
-                       var calcHeight = this.calcH();\r
-                       // ratios for the dimensions of the preview image\r
-                       var dimRatio = { \r
-                               x: this.imgW / calcWidth, \r
-                               y: this.imgH / calcHeight \r
-                       }; \r
-                       //ratios for the positions within the preview\r
-                       var posRatio = { \r
-                               x: calcWidth / this.options.minWidth, \r
-                               y: calcHeight / this.options.minHeight \r
-                       };\r
-                       \r
-                       // setting the positions in an obj before apply styles for rendering speed increase\r
-                       var calcPos     = {\r
-                               w: Math.ceil( this.options.minWidth * dimRatio.x ) + 'px',\r
-                               h: Math.ceil( this.options.minHeight * dimRatio.y ) + 'px',\r
-                               x: '-' + Math.ceil( this.areaCoords.x1 / posRatio.x )  + 'px',\r
-                               y: '-' + Math.ceil( this.areaCoords.y1 / posRatio.y ) + 'px'\r
-                       }\r
-                       \r
-                       var previewStyle        = this.previewImg.style;\r
-                       previewStyle.width      = calcPos.w;\r
-                       previewStyle.height     = calcPos.h;\r
-                       previewStyle.left       = calcPos.x;\r
-                       previewStyle.top        = calcPos.y;\r
-               }\r
-       }\r
-       \r
-});\r
diff --git a/view/js/cropper/lib/builder.js b/view/js/cropper/lib/builder.js
deleted file mode 100644 (file)
index 5b15ba9..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-//
-// See scriptaculous.js for full license.
-
-var Builder = {
-  NODEMAP: {
-    AREA: 'map',
-    CAPTION: 'table',
-    COL: 'table',
-    COLGROUP: 'table',
-    LEGEND: 'fieldset',
-    OPTGROUP: 'select',
-    OPTION: 'select',
-    PARAM: 'object',
-    TBODY: 'table',
-    TD: 'table',
-    TFOOT: 'table',
-    TH: 'table',
-    THEAD: 'table',
-    TR: 'table'
-  },
-  // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
-  //       due to a Firefox bug
-  node: function(elementName) {
-    elementName = elementName.toUpperCase();
-    
-    // try innerHTML approach
-    var parentTag = this.NODEMAP[elementName] || 'div';
-    var parentElement = document.createElement(parentTag);
-    try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
-      parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
-    } catch(e) {}
-    var element = parentElement.firstChild || null;
-      
-    // see if browser added wrapping tags
-    if(element && (element.tagName != elementName))
-      element = element.getElementsByTagName(elementName)[0];
-    
-    // fallback to createElement approach
-    if(!element) element = document.createElement(elementName);
-    
-    // abort if nothing could be created
-    if(!element) return;
-
-    // attributes (or text)
-    if(arguments[1])
-      if(this._isStringOrNumber(arguments[1]) ||
-        (arguments[1] instanceof Array)) {
-          this._children(element, arguments[1]);
-        } else {
-          var attrs = this._attributes(arguments[1]);
-          if(attrs.length) {
-            try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
-              parentElement.innerHTML = "<" +elementName + " " +
-                attrs + "></" + elementName + ">";
-            } catch(e) {}
-            element = parentElement.firstChild || null;
-            // workaround firefox 1.0.X bug
-            if(!element) {
-              element = document.createElement(elementName);
-              for(attr in arguments[1]) 
-                element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
-            }
-            if(element.tagName != elementName)
-              element = parentElement.getElementsByTagName(elementName)[0];
-            }
-        } 
-
-    // text, or array of children
-    if(arguments[2])
-      this._children(element, arguments[2]);
-
-     return element;
-  },
-  _text: function(text) {
-     return document.createTextNode(text);
-  },
-  _attributes: function(attributes) {
-    var attrs = [];
-    for(attribute in attributes)
-      attrs.push((attribute=='className' ? 'class' : attribute) +
-          '="' + attributes[attribute].toString().escapeHTML() + '"');
-    return attrs.join(" ");
-  },
-  _children: function(element, children) {
-    if(typeof children=='object') { // array can hold nodes and text
-      children.flatten().each( function(e) {
-        if(typeof e=='object')
-          element.appendChild(e)
-        else
-          if(Builder._isStringOrNumber(e))
-            element.appendChild(Builder._text(e));
-      });
-    } else
-      if(Builder._isStringOrNumber(children)) 
-         element.appendChild(Builder._text(children));
-  },
-  _isStringOrNumber: function(param) {
-    return(typeof param=='string' || typeof param=='number');
-  }
-}
\ No newline at end of file
diff --git a/view/js/cropper/lib/controls.js b/view/js/cropper/lib/controls.js
deleted file mode 100644 (file)
index 9606948..0000000
+++ /dev/null
@@ -1,815 +0,0 @@
-// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-//           (c) 2005 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
-//           (c) 2005 Jon Tirsen (http://www.tirsen.com)
-// Contributors:
-//  Richard Livsey
-//  Rahul Bhargava
-//  Rob Wills
-// 
-// See scriptaculous.js for full license.
-
-// Autocompleter.Base handles all the autocompletion functionality 
-// that's independent of the data source for autocompletion. This
-// includes drawing the autocompletion menu, observing keyboard
-// and mouse events, and similar.
-//
-// Specific autocompleters need to provide, at the very least, 
-// a getUpdatedChoices function that will be invoked every time
-// the text inside the monitored textbox changes. This method 
-// should get the text for which to provide autocompletion by
-// invoking this.getToken(), NOT by directly accessing
-// this.element.value. This is to allow incremental tokenized
-// autocompletion. Specific auto-completion logic (AJAX, etc)
-// belongs in getUpdatedChoices.
-//
-// Tokenized incremental autocompletion is enabled automatically
-// when an autocompleter is instantiated with the 'tokens' option
-// in the options parameter, e.g.:
-// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
-// will incrementally autocomplete with a comma as the token.
-// Additionally, ',' in the above example can be replaced with
-// a token array, e.g. { tokens: [',', '\n'] } which
-// enables autocompletion on multiple tokens. This is most 
-// useful when one of the tokens is \n (a newline), as it 
-// allows smart autocompletion after linebreaks.
-
-var Autocompleter = {}
-Autocompleter.Base = function() {};
-Autocompleter.Base.prototype = {
-  baseInitialize: function(element, update, options) {
-    this.element     = $PR(element); 
-    this.update      = $PR(update);  
-    this.hasFocus    = false; 
-    this.changed     = false; 
-    this.active      = false; 
-    this.index       = 0;     
-    this.entryCount  = 0;
-
-    if (this.setOptions)
-      this.setOptions(options);
-    else
-      this.options = options || {};
-
-    this.options.paramName    = this.options.paramName || this.element.name;
-    this.options.tokens       = this.options.tokens || [];
-    this.options.frequency    = this.options.frequency || 0.4;
-    this.options.minChars     = this.options.minChars || 1;
-    this.options.onShow       = this.options.onShow || 
-    function(element, update){ 
-      if(!update.style.position || update.style.position=='absolute') {
-        update.style.position = 'absolute';
-        Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight});
-      }
-      Effect.Appear(update,{duration:0.15});
-    };
-    this.options.onHide = this.options.onHide || 
-    function(element, update){ new Effect.Fade(update,{duration:0.15}) };
-
-    if (typeof(this.options.tokens) == 'string') 
-      this.options.tokens = new Array(this.options.tokens);
-
-    this.observer = null;
-    
-    this.element.setAttribute('autocomplete','off');
-
-    Element.hide(this.update);
-
-    Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this));
-    Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this));
-  },
-
-  show: function() {
-    if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
-    if(!this.iefix && 
-      (navigator.appVersion.indexOf('MSIE')>0) &&
-      (navigator.userAgent.indexOf('Opera')<0) &&
-      (Element.getStyle(this.update, 'position')=='absolute')) {
-      new Insertion.After(this.update, 
-       '<iframe id="' + this.update.id + '_iefix" '+
-       'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
-       'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
-      this.iefix = $PR(this.update.id+'_iefix');
-    }
-    if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
-  },
-  
-  fixIEOverlapping: function() {
-    Position.clone(this.update, this.iefix);
-    this.iefix.style.zIndex = 1;
-    this.update.style.zIndex = 2;
-    Element.show(this.iefix);
-  },
-
-  hide: function() {
-    this.stopIndicator();
-    if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
-    if(this.iefix) Element.hide(this.iefix);
-  },
-
-  startIndicator: function() {
-    if(this.options.indicator) Element.show(this.options.indicator);
-  },
-
-  stopIndicator: function() {
-    if(this.options.indicator) Element.hide(this.options.indicator);
-  },
-
-  onKeyPress: function(event) {
-    if(this.active)
-      switch(event.keyCode) {
-       case Event.KEY_TAB:
-       case Event.KEY_RETURN:
-         this.selectEntry();
-         Event.stop(event);
-       case Event.KEY_ESC:
-         this.hide();
-         this.active = false;
-         Event.stop(event);
-         return;
-       case Event.KEY_LEFT:
-       case Event.KEY_RIGHT:
-         return;
-       case Event.KEY_UP:
-         this.markPrevious();
-         this.render();
-         if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
-         return;
-       case Event.KEY_DOWN:
-         this.markNext();
-         this.render();
-         if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
-         return;
-      }
-     else 
-       if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || 
-         (navigator.appVersion.indexOf('AppleWebKit') > 0 && event.keyCode == 0)) return;
-
-    this.changed = true;
-    this.hasFocus = true;
-
-    if(this.observer) clearTimeout(this.observer);
-      this.observer = 
-        setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
-  },
-
-  activate: function() {
-    this.changed = false;
-    this.hasFocus = true;
-    this.getUpdatedChoices();
-  },
-
-  onHover: function(event) {
-    var element = Event.findElement(event, 'LI');
-    if(this.index != element.autocompleteIndex) 
-    {
-        this.index = element.autocompleteIndex;
-        this.render();
-    }
-    Event.stop(event);
-  },
-  
-  onClick: function(event) {
-    var element = Event.findElement(event, 'LI');
-    this.index = element.autocompleteIndex;
-    this.selectEntry();
-    this.hide();
-  },
-  
-  onBlur: function(event) {
-    // needed to make click events working
-    setTimeout(this.hide.bind(this), 250);
-    this.hasFocus = false;
-    this.active = false;     
-  }, 
-  
-  render: function() {
-    if(this.entryCount > 0) {
-      for (var i = 0; i < this.entryCount; i++)
-        this.index==i ? 
-          Element.addClassName(this.getEntry(i),"selected") : 
-          Element.removeClassName(this.getEntry(i),"selected");
-        
-      if(this.hasFocus) { 
-        this.show();
-        this.active = true;
-      }
-    } else {
-      this.active = false;
-      this.hide();
-    }
-  },
-  
-  markPrevious: function() {
-    if(this.index > 0) this.index--
-      else this.index = this.entryCount-1;
-  },
-  
-  markNext: function() {
-    if(this.index < this.entryCount-1) this.index++
-      else this.index = 0;
-  },
-  
-  getEntry: function(index) {
-    return this.update.firstChild.childNodes[index];
-  },
-  
-  getCurrentEntry: function() {
-    return this.getEntry(this.index);
-  },
-  
-  selectEntry: function() {
-    this.active = false;
-    this.updateElement(this.getCurrentEntry());
-  },
-
-  updateElement: function(selectedElement) {
-    if (this.options.updateElement) {
-      this.options.updateElement(selectedElement);
-      return;
-    }
-    var value = '';
-    if (this.options.select) {
-      var nodes = document.getElementsByClassName(this.options.select, selectedElement) || [];
-      if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
-    } else
-      value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
-    
-    var lastTokenPos = this.findLastToken();
-    if (lastTokenPos != -1) {
-      var newValue = this.element.value.substr(0, lastTokenPos + 1);
-      var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/);
-      if (whitespace)
-        newValue += whitespace[0];
-      this.element.value = newValue + value;
-    } else {
-      this.element.value = value;
-    }
-    this.element.focus();
-    
-    if (this.options.afterUpdateElement)
-      this.options.afterUpdateElement(this.element, selectedElement);
-  },
-
-  updateChoices: function(choices) {
-    if(!this.changed && this.hasFocus) {
-      this.update.innerHTML = choices;
-      Element.cleanWhitespace(this.update);
-      Element.cleanWhitespace(this.update.firstChild);
-
-      if(this.update.firstChild && this.update.firstChild.childNodes) {
-        this.entryCount = 
-          this.update.firstChild.childNodes.length;
-        for (var i = 0; i < this.entryCount; i++) {
-          var entry = this.getEntry(i);
-          entry.autocompleteIndex = i;
-          this.addObservers(entry);
-        }
-      } else { 
-        this.entryCount = 0;
-      }
-
-      this.stopIndicator();
-
-      this.index = 0;
-      this.render();
-    }
-  },
-
-  addObservers: function(element) {
-    Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
-    Event.observe(element, "click", this.onClick.bindAsEventListener(this));
-  },
-
-  onObserverEvent: function() {
-    this.changed = false;   
-    if(this.getToken().length>=this.options.minChars) {
-      this.startIndicator();
-      this.getUpdatedChoices();
-    } else {
-      this.active = false;
-      this.hide();
-    }
-  },
-
-  getToken: function() {
-    var tokenPos = this.findLastToken();
-    if (tokenPos != -1)
-      var ret = this.element.value.substr(tokenPos + 1).replace(/^\s+/,'').replace(/\s+$/,'');
-    else
-      var ret = this.element.value;
-
-    return /\n/.test(ret) ? '' : ret;
-  },
-
-  findLastToken: function() {
-    var lastTokenPos = -1;
-
-    for (var i=0; i<this.options.tokens.length; i++) {
-      var thisTokenPos = this.element.value.lastIndexOf(this.options.tokens[i]);
-      if (thisTokenPos > lastTokenPos)
-        lastTokenPos = thisTokenPos;
-    }
-    return lastTokenPos;
-  }
-}
-
-Ajax.Autocompleter = Class.create();
-Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), {
-  initialize: function(element, update, url, options) {
-    this.baseInitialize(element, update, options);
-    this.options.asynchronous  = true;
-    this.options.onComplete    = this.onComplete.bind(this);
-    this.options.defaultParams = this.options.parameters || null;
-    this.url                   = url;
-  },
-
-  getUpdatedChoices: function() {
-    entry = encodeURIComponent(this.options.paramName) + '=' + 
-      encodeURIComponent(this.getToken());
-
-    this.options.parameters = this.options.callback ?
-      this.options.callback(this.element, entry) : entry;
-
-    if(this.options.defaultParams) 
-      this.options.parameters += '&' + this.options.defaultParams;
-
-    new Ajax.Request(this.url, this.options);
-  },
-
-  onComplete: function(request) {
-    this.updateChoices(request.responseText);
-  }
-
-});
-
-// The local array autocompleter. Used when you'd prefer to
-// inject an array of autocompletion options into the page, rather
-// than sending out Ajax queries, which can be quite slow sometimes.
-//
-// The constructor takes four parameters. The first two are, as usual,
-// the id of the monitored textbox, and id of the autocompletion menu.
-// The third is the array you want to autocomplete from, and the fourth
-// is the options block.
-//
-// Extra local autocompletion options:
-// - choices - How many autocompletion choices to offer
-//
-// - partialSearch - If false, the autocompleter will match entered
-//                    text only at the beginning of strings in the 
-//                    autocomplete array. Defaults to true, which will
-//                    match text at the beginning of any *word* in the
-//                    strings in the autocomplete array. If you want to
-//                    search anywhere in the string, additionally set
-//                    the option fullSearch to true (default: off).
-//
-// - fullSsearch - Search anywhere in autocomplete array strings.
-//
-// - partialChars - How many characters to enter before triggering
-//                   a partial match (unlike minChars, which defines
-//                   how many characters are required to do any match
-//                   at all). Defaults to 2.
-//
-// - ignoreCase - Whether to ignore case when autocompleting.
-//                 Defaults to true.
-//
-// It's possible to pass in a custom function as the 'selector' 
-// option, if you prefer to write your own autocompletion logic.
-// In that case, the other options above will not apply unless
-// you support them.
-
-Autocompleter.Local = Class.create();
-Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), {
-  initialize: function(element, update, array, options) {
-    this.baseInitialize(element, update, options);
-    this.options.array = array;
-  },
-
-  getUpdatedChoices: function() {
-    this.updateChoices(this.options.selector(this));
-  },
-
-  setOptions: function(options) {
-    this.options = Object.extend({
-      choices: 10,
-      partialSearch: true,
-      partialChars: 2,
-      ignoreCase: true,
-      fullSearch: false,
-      selector: function(instance) {
-        var ret       = []; // Beginning matches
-        var partial   = []; // Inside matches
-        var entry     = instance.getToken();
-        var count     = 0;
-
-        for (var i = 0; i < instance.options.array.length &&  
-          ret.length < instance.options.choices ; i++) { 
-
-          var elem = instance.options.array[i];
-          var foundPos = instance.options.ignoreCase ? 
-            elem.toLowerCase().indexOf(entry.toLowerCase()) : 
-            elem.indexOf(entry);
-
-          while (foundPos != -1) {
-            if (foundPos == 0 && elem.length != entry.length) { 
-              ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + 
-                elem.substr(entry.length) + "</li>");
-              break;
-            } else if (entry.length >= instance.options.partialChars && 
-              instance.options.partialSearch && foundPos != -1) {
-              if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) {
-                partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" +
-                  elem.substr(foundPos, entry.length) + "</strong>" + elem.substr(
-                  foundPos + entry.length) + "</li>");
-                break;
-              }
-            }
-
-            foundPos = instance.options.ignoreCase ? 
-              elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : 
-              elem.indexOf(entry, foundPos + 1);
-
-          }
-        }
-        if (partial.length)
-          ret = ret.concat(partial.slice(0, instance.options.choices - ret.length))
-        return "<ul>" + ret.join('') + "</ul>";
-      }
-    }, options || {});
-  }
-});
-
-// AJAX in-place editor
-//
-// see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor
-
-// Use this if you notice weird scrolling problems on some browsers,
-// the DOM might be a bit confused when this gets called so do this
-// waits 1 ms (with setTimeout) until it does the activation
-Field.scrollFreeActivate = function(field) {
-  setTimeout(function() {
-    Field.activate(field);
-  }, 1);
-}
-
-Ajax.InPlaceEditor = Class.create();
-Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99";
-Ajax.InPlaceEditor.prototype = {
-  initialize: function(element, url, options) {
-    this.url = url;
-    this.element = $PR(element);
-
-    this.options = Object.extend({
-      okButton: true,
-      okText: "ok",
-      cancelLink: true,
-      cancelText: "cancel",
-      savingText: "Saving...",
-      clickToEditText: "Click to edit",
-      okText: "ok",
-      rows: 1,
-      onComplete: function(transport, element) {
-        new Effect.Highlight(element, {startcolor: this.options.highlightcolor});
-      },
-      onFailure: function(transport) {
-        alert("Error communicating with the server: " + transport.responseText.stripTags());
-      },
-      callback: function(form) {
-        return Form.serialize(form);
-      },
-      handleLineBreaks: true,
-      loadingText: 'Loading...',
-      savingClassName: 'inplaceeditor-saving',
-      loadingClassName: 'inplaceeditor-loading',
-      formClassName: 'inplaceeditor-form',
-      highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor,
-      highlightendcolor: "#FFFFFF",
-      externalControl: null,
-      submitOnBlur: false,
-      ajaxOptions: {},
-      evalScripts: false
-    }, options || {});
-
-    if(!this.options.formId && this.element.id) {
-      this.options.formId = this.element.id + "-inplaceeditor";
-      if ($PR(this.options.formId)) {
-        // there's already a form with that name, don't specify an id
-        this.options.formId = null;
-      }
-    }
-    
-    if (this.options.externalControl) {
-      this.options.externalControl = $PR(this.options.externalControl);
-    }
-    
-    this.originalBackground = Element.getStyle(this.element, 'background-color');
-    if (!this.originalBackground) {
-      this.originalBackground = "transparent";
-    }
-    
-    this.element.title = this.options.clickToEditText;
-    
-    this.onclickListener = this.enterEditMode.bindAsEventListener(this);
-    this.mouseoverListener = this.enterHover.bindAsEventListener(this);
-    this.mouseoutListener = this.leaveHover.bindAsEventListener(this);
-    Event.observe(this.element, 'click', this.onclickListener);
-    Event.observe(this.element, 'mouseover', this.mouseoverListener);
-    Event.observe(this.element, 'mouseout', this.mouseoutListener);
-    if (this.options.externalControl) {
-      Event.observe(this.options.externalControl, 'click', this.onclickListener);
-      Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener);
-      Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener);
-    }
-  },
-  enterEditMode: function(evt) {
-    if (this.saving) return;
-    if (this.editing) return;
-    this.editing = true;
-    this.onEnterEditMode();
-    if (this.options.externalControl) {
-      Element.hide(this.options.externalControl);
-    }
-    Element.hide(this.element);
-    this.createForm();
-    this.element.parentNode.insertBefore(this.form, this.element);
-    Field.scrollFreeActivate(this.editField);
-    // stop the event to avoid a page refresh in Safari
-    if (evt) {
-      Event.stop(evt);
-    }
-    return false;
-  },
-  createForm: function() {
-    this.form = document.createElement("form");
-    this.form.id = this.options.formId;
-    Element.addClassName(this.form, this.options.formClassName)
-    this.form.onsubmit = this.onSubmit.bind(this);
-
-    this.createEditField();
-
-    if (this.options.textarea) {
-      var br = document.createElement("br");
-      this.form.appendChild(br);
-    }
-
-    if (this.options.okButton) {
-      okButton = document.createElement("input");
-      okButton.type = "submit";
-      okButton.value = this.options.okText;
-      okButton.className = 'editor_ok_button';
-      this.form.appendChild(okButton);
-    }
-
-    if (this.options.cancelLink) {
-      cancelLink = document.createElement("a");
-      cancelLink.href = "#";
-      cancelLink.appendChild(document.createTextNode(this.options.cancelText));
-      cancelLink.onclick = this.onclickCancel.bind(this);
-      cancelLink.className = 'editor_cancel';      
-      this.form.appendChild(cancelLink);
-    }
-  },
-  hasHTMLLineBreaks: function(string) {
-    if (!this.options.handleLineBreaks) return false;
-    return string.match(/<br/i) || string.match(/<p>/i);
-  },
-  convertHTMLLineBreaks: function(string) {
-    return string.replace(/<br>/gi, "\n").replace(/<br\/>/gi, "\n").replace(/<\/p>/gi, "\n").replace(/<p>/gi, "");
-  },
-  createEditField: function() {
-    var text;
-    if(this.options.loadTextURL) {
-      text = this.options.loadingText;
-    } else {
-      text = this.getText();
-    }
-
-    var obj = this;
-    
-    if (this.options.rows == 1 && !this.hasHTMLLineBreaks(text)) {
-      this.options.textarea = false;
-      var textField = document.createElement("input");
-      textField.obj = this;
-      textField.type = "text";
-      textField.name = "value";
-      textField.value = text;
-      textField.style.backgroundColor = this.options.highlightcolor;
-      textField.className = 'editor_field';
-      var size = this.options.size || this.options.cols || 0;
-      if (size != 0) textField.size = size;
-      if (this.options.submitOnBlur)
-        textField.onblur = this.onSubmit.bind(this);
-      this.editField = textField;
-    } else {
-      this.options.textarea = true;
-      var textArea = document.createElement("textarea");
-      textArea.obj = this;
-      textArea.name = "value";
-      textArea.value = this.convertHTMLLineBreaks(text);
-      textArea.rows = this.options.rows;
-      textArea.cols = this.options.cols || 40;
-      textArea.className = 'editor_field';      
-      if (this.options.submitOnBlur)
-        textArea.onblur = this.onSubmit.bind(this);
-      this.editField = textArea;
-    }
-    
-    if(this.options.loadTextURL) {
-      this.loadExternalText();
-    }
-    this.form.appendChild(this.editField);
-  },
-  getText: function() {
-    return this.element.innerHTML;
-  },
-  loadExternalText: function() {
-    Element.addClassName(this.form, this.options.loadingClassName);
-    this.editField.disabled = true;
-    new Ajax.Request(
-      this.options.loadTextURL,
-      Object.extend({
-        asynchronous: true,
-        onComplete: this.onLoadedExternalText.bind(this)
-      }, this.options.ajaxOptions)
-    );
-  },
-  onLoadedExternalText: function(transport) {
-    Element.removeClassName(this.form, this.options.loadingClassName);
-    this.editField.disabled = false;
-    this.editField.value = transport.responseText.stripTags();
-  },
-  onclickCancel: function() {
-    this.onComplete();
-    this.leaveEditMode();
-    return false;
-  },
-  onFailure: function(transport) {
-    this.options.onFailure(transport);
-    if (this.oldInnerHTML) {
-      this.element.innerHTML = this.oldInnerHTML;
-      this.oldInnerHTML = null;
-    }
-    return false;
-  },
-  onSubmit: function() {
-    // onLoading resets these so we need to save them away for the Ajax call
-    var form = this.form;
-    var value = this.editField.value;
-    
-    // do this first, sometimes the ajax call returns before we get a chance to switch on Saving...
-    // which means this will actually switch on Saving... *after* we've left edit mode causing Saving...
-    // to be displayed indefinitely
-    this.onLoading();
-    
-    if (this.options.evalScripts) {
-      new Ajax.Request(
-        this.url, Object.extend({
-          parameters: this.options.callback(form, value),
-          onComplete: this.onComplete.bind(this),
-          onFailure: this.onFailure.bind(this),
-          asynchronous:true, 
-          evalScripts:true
-        }, this.options.ajaxOptions));
-    } else  {
-      new Ajax.Updater(
-        { success: this.element,
-          // don't update on failure (this could be an option)
-          failure: null }, 
-        this.url, Object.extend({
-          parameters: this.options.callback(form, value),
-          onComplete: this.onComplete.bind(this),
-          onFailure: this.onFailure.bind(this)
-        }, this.options.ajaxOptions));
-    }
-    // stop the event to avoid a page refresh in Safari
-    if (arguments.length > 1) {
-      Event.stop(arguments[0]);
-    }
-    return false;
-  },
-  onLoading: function() {
-    this.saving = true;
-    this.removeForm();
-    this.leaveHover();
-    this.showSaving();
-  },
-  showSaving: function() {
-    this.oldInnerHTML = this.element.innerHTML;
-    this.element.innerHTML = this.options.savingText;
-    Element.addClassName(this.element, this.options.savingClassName);
-    this.element.style.backgroundColor = this.originalBackground;
-    Element.show(this.element);
-  },
-  removeForm: function() {
-    if(this.form) {
-      if (this.form.parentNode) Element.remove(this.form);
-      this.form = null;
-    }
-  },
-  enterHover: function() {
-    if (this.saving) return;
-    this.element.style.backgroundColor = this.options.highlightcolor;
-    if (this.effect) {
-      this.effect.cancel();
-    }
-    Element.addClassName(this.element, this.options.hoverClassName)
-  },
-  leaveHover: function() {
-    if (this.options.backgroundColor) {
-      this.element.style.backgroundColor = this.oldBackground;
-    }
-    Element.removeClassName(this.element, this.options.hoverClassName)
-    if (this.saving) return;
-    this.effect = new Effect.Highlight(this.element, {
-      startcolor: this.options.highlightcolor,
-      endcolor: this.options.highlightendcolor,
-      restorecolor: this.originalBackground
-    });
-  },
-  leaveEditMode: function() {
-    Element.removeClassName(this.element, this.options.savingClassName);
-    this.removeForm();
-    this.leaveHover();
-    this.element.style.backgroundColor = this.originalBackground;
-    Element.show(this.element);
-    if (this.options.externalControl) {
-      Element.show(this.options.externalControl);
-    }
-    this.editing = false;
-    this.saving = false;
-    this.oldInnerHTML = null;
-    this.onLeaveEditMode();
-  },
-  onComplete: function(transport) {
-    this.leaveEditMode();
-    this.options.onComplete.bind(this)(transport, this.element);
-  },
-  onEnterEditMode: function() {},
-  onLeaveEditMode: function() {},
-  dispose: function() {
-    if (this.oldInnerHTML) {
-      this.element.innerHTML = this.oldInnerHTML;
-    }
-    this.leaveEditMode();
-    Event.stopObserving(this.element, 'click', this.onclickListener);
-    Event.stopObserving(this.element, 'mouseover', this.mouseoverListener);
-    Event.stopObserving(this.element, 'mouseout', this.mouseoutListener);
-    if (this.options.externalControl) {
-      Event.stopObserving(this.options.externalControl, 'click', this.onclickListener);
-      Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener);
-      Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener);
-    }
-  }
-};
-
-Ajax.InPlaceCollectionEditor = Class.create();
-Object.extend(Ajax.InPlaceCollectionEditor.prototype, Ajax.InPlaceEditor.prototype);
-Object.extend(Ajax.InPlaceCollectionEditor.prototype, {
-  createEditField: function() {
-    if (!this.cached_selectTag) {
-      var selectTag = document.createElement("select");
-      var collection = this.options.collection || [];
-      var optionTag;
-      collection.each(function(e,i) {
-        optionTag = document.createElement("option");
-        optionTag.value = (e instanceof Array) ? e[0] : e;
-        if(this.options.value==optionTag.value) optionTag.selected = true;
-        optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e));
-        selectTag.appendChild(optionTag);
-      }.bind(this));
-      this.cached_selectTag = selectTag;
-    }
-
-    this.editField = this.cached_selectTag;
-    if(this.options.loadTextURL) this.loadExternalText();
-    this.form.appendChild(this.editField);
-    this.options.callback = function(form, value) {
-      return "value=" + encodeURIComponent(value);
-    }
-  }
-});
-
-// Delayed observer, like Form.Element.Observer, 
-// but waits for delay after last key input
-// Ideal for live-search fields
-
-Form.Element.DelayedObserver = Class.create();
-Form.Element.DelayedObserver.prototype = {
-  initialize: function(element, delay, callback) {
-    this.delay     = delay || 0.5;
-    this.element   = $PR(element);
-    this.callback  = callback;
-    this.timer     = null;
-    this.lastValue = $F(this.element); 
-    Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));
-  },
-  delayedListener: function(event) {
-    if(this.lastValue == $F(this.element)) return;
-    if(this.timer) clearTimeout(this.timer);
-    this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000);
-    this.lastValue = $F(this.element);
-  },
-  onTimerEvent: function() {
-    this.timer = null;
-    this.callback(this.element, $F(this.element));
-  }
-};
diff --git a/view/js/cropper/lib/dragdrop.js b/view/js/cropper/lib/dragdrop.js
deleted file mode 100644 (file)
index baa607c..0000000
+++ /dev/null
@@ -1,915 +0,0 @@
-// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-//           (c) 2005 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
-// 
-// See scriptaculous.js for full license.
-
-/*--------------------------------------------------------------------------*/
-
-var Droppables = {
-  drops: [],
-
-  remove: function(element) {
-    this.drops = this.drops.reject(function(d) { return d.element==$PR(element) });
-  },
-
-  add: function(element) {
-    element = $PR(element);
-    var options = Object.extend({
-      greedy:     true,
-      hoverclass: null,
-      tree:       false
-    }, arguments[1] || {});
-
-    // cache containers
-    if(options.containment) {
-      options._containers = [];
-      var containment = options.containment;
-      if((typeof containment == 'object') && 
-        (containment.constructor == Array)) {
-        containment.each( function(c) { options._containers.push($PR(c)) });
-      } else {
-        options._containers.push($PR(containment));
-      }
-    }
-    
-    if(options.accept) options.accept = [options.accept].flatten();
-
-    Element.makePositioned(element); // fix IE
-    options.element = element;
-
-    this.drops.push(options);
-  },
-  
-  findDeepestChild: function(drops) {
-    deepest = drops[0];
-      
-    for (i = 1; i < drops.length; ++i)
-      if (Element.isParent(drops[i].element, deepest.element))
-        deepest = drops[i];
-    
-    return deepest;
-  },
-
-  isContained: function(element, drop) {
-    var containmentNode;
-    if(drop.tree) {
-      containmentNode = element.treeNode; 
-    } else {
-      containmentNode = element.parentNode;
-    }
-    return drop._containers.detect(function(c) { return containmentNode == c });
-  },
-  
-  isAffected: function(point, element, drop) {
-    return (
-      (drop.element!=element) &&
-      ((!drop._containers) ||
-        this.isContained(element, drop)) &&
-      ((!drop.accept) ||
-        (Element.classNames(element).detect( 
-          function(v) { return drop.accept.include(v) } ) )) &&
-      Position.within(drop.element, point[0], point[1]) );
-  },
-
-  deactivate: function(drop) {
-    if(drop.hoverclass)
-      Element.removeClassName(drop.element, drop.hoverclass);
-    this.last_active = null;
-  },
-
-  activate: function(drop) {
-    if(drop.hoverclass)
-      Element.addClassName(drop.element, drop.hoverclass);
-    this.last_active = drop;
-  },
-
-  show: function(point, element) {
-    if(!this.drops.length) return;
-    var affected = [];
-    
-    if(this.last_active) this.deactivate(this.last_active);
-    this.drops.each( function(drop) {
-      if(Droppables.isAffected(point, element, drop))
-        affected.push(drop);
-    });
-        
-    if(affected.length>0) {
-      drop = Droppables.findDeepestChild(affected);
-      Position.within(drop.element, point[0], point[1]);
-      if(drop.onHover)
-        drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
-      
-      Droppables.activate(drop);
-    }
-  },
-
-  fire: function(event, element) {
-    if(!this.last_active) return;
-    Position.prepare();
-
-    if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
-      if (this.last_active.onDrop) 
-        this.last_active.onDrop(element, this.last_active.element, event);
-  },
-
-  reset: function() {
-    if(this.last_active)
-      this.deactivate(this.last_active);
-  }
-}
-
-var Draggables = {
-  drags: [],
-  observers: [],
-  
-  register: function(draggable) {
-    if(this.drags.length == 0) {
-      this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
-      this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
-      this.eventKeypress  = this.keyPress.bindAsEventListener(this);
-      
-      Event.observe(document, "mouseup", this.eventMouseUp);
-      Event.observe(document, "mousemove", this.eventMouseMove);
-      Event.observe(document, "keypress", this.eventKeypress);
-    }
-    this.drags.push(draggable);
-  },
-  
-  unregister: function(draggable) {
-    this.drags = this.drags.reject(function(d) { return d==draggable });
-    if(this.drags.length == 0) {
-      Event.stopObserving(document, "mouseup", this.eventMouseUp);
-      Event.stopObserving(document, "mousemove", this.eventMouseMove);
-      Event.stopObserving(document, "keypress", this.eventKeypress);
-    }
-  },
-  
-  activate: function(draggable) {
-    window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
-    this.activeDraggable = draggable;
-  },
-  
-  deactivate: function() {
-    this.activeDraggable = null;
-  },
-  
-  updateDrag: function(event) {
-    if(!this.activeDraggable) return;
-    var pointer = [Event.pointerX(event), Event.pointerY(event)];
-    // Mozilla-based browsers fire successive mousemove events with
-    // the same coordinates, prevent needless redrawing (moz bug?)
-    if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
-    this._lastPointer = pointer;
-    this.activeDraggable.updateDrag(event, pointer);
-  },
-  
-  endDrag: function(event) {
-    if(!this.activeDraggable) return;
-    this._lastPointer = null;
-    this.activeDraggable.endDrag(event);
-    this.activeDraggable = null;
-  },
-  
-  keyPress: function(event) {
-    if(this.activeDraggable)
-      this.activeDraggable.keyPress(event);
-  },
-  
-  addObserver: function(observer) {
-    this.observers.push(observer);
-    this._cacheObserverCallbacks();
-  },
-  
-  removeObserver: function(element) {  // element instead of observer fixes mem leaks
-    this.observers = this.observers.reject( function(o) { return o.element==element });
-    this._cacheObserverCallbacks();
-  },
-  
-  notify: function(eventName, draggable, event) {  // 'onStart', 'onEnd', 'onDrag'
-    if(this[eventName+'Count'] > 0)
-      this.observers.each( function(o) {
-        if(o[eventName]) o[eventName](eventName, draggable, event);
-      });
-  },
-  
-  _cacheObserverCallbacks: function() {
-    ['onStart','onEnd','onDrag'].each( function(eventName) {
-      Draggables[eventName+'Count'] = Draggables.observers.select(
-        function(o) { return o[eventName]; }
-      ).length;
-    });
-  }
-}
-
-/*--------------------------------------------------------------------------*/
-
-var Draggable = Class.create();
-Draggable.prototype = {
-  initialize: function(element) {
-    var options = Object.extend({
-      handle: false,
-      starteffect: function(element) {
-        element._opacity = Element.getOpacity(element); 
-        new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); 
-      },
-      reverteffect: function(element, top_offset, left_offset) {
-        var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
-        element._revert = new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur});
-      },
-      endeffect: function(element) {
-        var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0
-        new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity}); 
-      },
-      zindex: 1000,
-      revert: false,
-      scroll: false,
-      scrollSensitivity: 20,
-      scrollSpeed: 15,
-      snap: false   // false, or xy or [x,y] or function(x,y){ return [x,y] }
-    }, arguments[1] || {});
-
-    this.element = $PR(element);
-    
-    if(options.handle && (typeof options.handle == 'string')) {
-      var h = Element.childrenWithClassName(this.element, options.handle, true);
-      if(h.length>0) this.handle = h[0];
-    }
-    if(!this.handle) this.handle = $PR(options.handle);
-    if(!this.handle) this.handle = this.element;
-    
-    if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML)
-      options.scroll = $PR(options.scroll);
-
-    Element.makePositioned(this.element); // fix IE    
-
-    this.delta    = this.currentDelta();
-    this.options  = options;
-    this.dragging = false;   
-
-    this.eventMouseDown = this.initDrag.bindAsEventListener(this);
-    Event.observe(this.handle, "mousedown", this.eventMouseDown);
-    
-    Draggables.register(this);
-  },
-  
-  destroy: function() {
-    Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
-    Draggables.unregister(this);
-  },
-  
-  currentDelta: function() {
-    return([
-      parseInt(Element.getStyle(this.element,'left') || '0'),
-      parseInt(Element.getStyle(this.element,'top') || '0')]);
-  },
-  
-  initDrag: function(event) {
-    if(Event.isLeftClick(event)) {    
-      // abort on form elements, fixes a Firefox issue
-      var src = Event.element(event);
-      if(src.tagName && (
-        src.tagName=='INPUT' ||
-        src.tagName=='SELECT' ||
-        src.tagName=='OPTION' ||
-        src.tagName=='BUTTON' ||
-        src.tagName=='TEXTAREA')) return;
-        
-      if(this.element._revert) {
-        this.element._revert.cancel();
-        this.element._revert = null;
-      }
-      
-      var pointer = [Event.pointerX(event), Event.pointerY(event)];
-      var pos     = Position.cumulativeOffset(this.element);
-      this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
-      
-      Draggables.activate(this);
-      Event.stop(event);
-    }
-  },
-  
-  startDrag: function(event) {
-    this.dragging = true;
-    
-    if(this.options.zindex) {
-      this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
-      this.element.style.zIndex = this.options.zindex;
-    }
-    
-    if(this.options.ghosting) {
-      this._clone = this.element.cloneNode(true);
-      Position.absolutize(this.element);
-      this.element.parentNode.insertBefore(this._clone, this.element);
-    }
-    
-    if(this.options.scroll) {
-      if (this.options.scroll == window) {
-        var where = this._getWindowScroll(this.options.scroll);
-        this.originalScrollLeft = where.left;
-        this.originalScrollTop = where.top;
-      } else {
-        this.originalScrollLeft = this.options.scroll.scrollLeft;
-        this.originalScrollTop = this.options.scroll.scrollTop;
-      }
-    }
-    
-    Draggables.notify('onStart', this, event);
-    if(this.options.starteffect) this.options.starteffect(this.element);
-  },
-  
-  updateDrag: function(event, pointer) {
-    if(!this.dragging) this.startDrag(event);
-    Position.prepare();
-    Droppables.show(pointer, this.element);
-    Draggables.notify('onDrag', this, event);
-    this.draw(pointer);
-    if(this.options.change) this.options.change(this);
-    
-    if(this.options.scroll) {
-      this.stopScrolling();
-      
-      var p;
-      if (this.options.scroll == window) {
-        with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
-      } else {
-        p = Position.page(this.options.scroll);
-        p[0] += this.options.scroll.scrollLeft;
-        p[1] += this.options.scroll.scrollTop;
-        p.push(p[0]+this.options.scroll.offsetWidth);
-        p.push(p[1]+this.options.scroll.offsetHeight);
-      }
-      var speed = [0,0];
-      if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity);
-      if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity);
-      if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity);
-      if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
-      this.startScrolling(speed);
-    }
-    
-    // fix AppleWebKit rendering
-    if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);
-    
-    Event.stop(event);
-  },
-  
-  finishDrag: function(event, success) {
-    this.dragging = false;
-
-    if(this.options.ghosting) {
-      Position.relativize(this.element);
-      Element.remove(this._clone);
-      this._clone = null;
-    }
-
-    if(success) Droppables.fire(event, this.element);
-    Draggables.notify('onEnd', this, event);
-
-    var revert = this.options.revert;
-    if(revert && typeof revert == 'function') revert = revert(this.element);
-    
-    var d = this.currentDelta();
-    if(revert && this.options.reverteffect) {
-      this.options.reverteffect(this.element, 
-        d[1]-this.delta[1], d[0]-this.delta[0]);
-    } else {
-      this.delta = d;
-    }
-
-    if(this.options.zindex)
-      this.element.style.zIndex = this.originalZ;
-
-    if(this.options.endeffect) 
-      this.options.endeffect(this.element);
-
-    Draggables.deactivate(this);
-    Droppables.reset();
-  },
-  
-  keyPress: function(event) {
-    if(event.keyCode!=Event.KEY_ESC) return;
-    this.finishDrag(event, false);
-    Event.stop(event);
-  },
-  
-  endDrag: function(event) {
-    if(!this.dragging) return;
-    this.stopScrolling();
-    this.finishDrag(event, true);
-    Event.stop(event);
-  },
-  
-  draw: function(point) {
-    var pos = Position.cumulativeOffset(this.element);
-    var d = this.currentDelta();
-    pos[0] -= d[0]; pos[1] -= d[1];
-    
-    if(this.options.scroll && (this.options.scroll != window)) {
-      pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
-      pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
-    }
-    
-    var p = [0,1].map(function(i){ 
-      return (point[i]-pos[i]-this.offset[i]) 
-    }.bind(this));
-    
-    if(this.options.snap) {
-      if(typeof this.options.snap == 'function') {
-        p = this.options.snap(p[0],p[1],this);
-      } else {
-      if(this.options.snap instanceof Array) {
-        p = p.map( function(v, i) {
-          return Math.round(v/this.options.snap[i])*this.options.snap[i] }.bind(this))
-      } else {
-        p = p.map( function(v) {
-          return Math.round(v/this.options.snap)*this.options.snap }.bind(this))
-      }
-    }}
-    
-    var style = this.element.style;
-    if((!this.options.constraint) || (this.options.constraint=='horizontal'))
-      style.left = p[0] + "px";
-    if((!this.options.constraint) || (this.options.constraint=='vertical'))
-      style.top  = p[1] + "px";
-    if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
-  },
-  
-  stopScrolling: function() {
-    if(this.scrollInterval) {
-      clearInterval(this.scrollInterval);
-      this.scrollInterval = null;
-      Draggables._lastScrollPointer = null;
-    }
-  },
-  
-  startScrolling: function(speed) {
-    this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
-    this.lastScrolled = new Date();
-    this.scrollInterval = setInterval(this.scroll.bind(this), 10);
-  },
-  
-  scroll: function() {
-    var current = new Date();
-    var delta = current - this.lastScrolled;
-    this.lastScrolled = current;
-    if(this.options.scroll == window) {
-      with (this._getWindowScroll(this.options.scroll)) {
-        if (this.scrollSpeed[0] || this.scrollSpeed[1]) {
-          var d = delta / 1000;
-          this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] );
-        }
-      }
-    } else {
-      this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
-      this.options.scroll.scrollTop  += this.scrollSpeed[1] * delta / 1000;
-    }
-    
-    Position.prepare();
-    Droppables.show(Draggables._lastPointer, this.element);
-    Draggables.notify('onDrag', this);
-    Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer);
-    Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000;
-    Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000;
-    if (Draggables._lastScrollPointer[0] < 0)
-      Draggables._lastScrollPointer[0] = 0;
-    if (Draggables._lastScrollPointer[1] < 0)
-      Draggables._lastScrollPointer[1] = 0;
-    this.draw(Draggables._lastScrollPointer);
-    
-    if(this.options.change) this.options.change(this);
-  },
-  
-  _getWindowScroll: function(w) {
-    var T, L, W, H;
-    with (w.document) {
-      if (w.document.documentElement && documentElement.scrollTop) {
-        T = documentElement.scrollTop;
-        L = documentElement.scrollLeft;
-      } else if (w.document.body) {
-        T = body.scrollTop;
-        L = body.scrollLeft;
-      }
-      if (w.innerWidth) {
-        W = w.innerWidth;
-        H = w.innerHeight;
-      } else if (w.document.documentElement && documentElement.clientWidth) {
-        W = documentElement.clientWidth;
-        H = documentElement.clientHeight;
-      } else {
-        W = body.offsetWidth;
-        H = body.offsetHeight
-      }
-    }
-    return { top: T, left: L, width: W, height: H };
-  }
-}
-
-/*--------------------------------------------------------------------------*/
-
-var SortableObserver = Class.create();
-SortableObserver.prototype = {
-  initialize: function(element, observer) {
-    this.element   = $PR(element);
-    this.observer  = observer;
-    this.lastValue = Sortable.serialize(this.element);
-  },
-  
-  onStart: function() {
-    this.lastValue = Sortable.serialize(this.element);
-  },
-  
-  onEnd: function() {
-    Sortable.unmark();
-    if(this.lastValue != Sortable.serialize(this.element))
-      this.observer(this.element)
-  }
-}
-
-var Sortable = {
-  sortables: {},
-  
-  _findRootElement: function(element) {
-    while (element.tagName != "BODY") {  
-      if(element.id && Sortable.sortables[element.id]) return element;
-      element = element.parentNode;
-    }
-  },
-
-  options: function(element) {
-    element = Sortable._findRootElement($PR(element));
-    if(!element) return;
-    return Sortable.sortables[element.id];
-  },
-  
-  destroy: function(element){
-    var s = Sortable.options(element);
-    
-    if(s) {
-      Draggables.removeObserver(s.element);
-      s.droppables.each(function(d){ Droppables.remove(d) });
-      s.draggables.invoke('destroy');
-      
-      delete Sortable.sortables[s.element.id];
-    }
-  },
-
-  create: function(element) {
-    element = $PR(element);
-    var options = Object.extend({ 
-      element:     element,
-      tag:         'li',       // assumes li children, override with tag: 'tagname'
-      dropOnEmpty: false,
-      tree:        false,
-      treeTag:     'ul',
-      overlap:     'vertical', // one of 'vertical', 'horizontal'
-      constraint:  'vertical', // one of 'vertical', 'horizontal', false
-      containment: element,    // also takes array of elements (or id's); or false
-      handle:      false,      // or a CSS class
-      only:        false,
-      hoverclass:  null,
-      ghosting:    false,
-      scroll:      false,
-      scrollSensitivity: 20,
-      scrollSpeed: 15,
-      format:      /^[^_]*_(.*)$/,
-      onChange:    Prototype.emptyFunction,
-      onUpdate:    Prototype.emptyFunction
-    }, arguments[1] || {});
-
-    // clear any old sortable with same element
-    this.destroy(element);
-
-    // build options for the draggables
-    var options_for_draggable = {
-      revert:      true,
-      scroll:      options.scroll,
-      scrollSpeed: options.scrollSpeed,
-      scrollSensitivity: options.scrollSensitivity,
-      ghosting:    options.ghosting,
-      constraint:  options.constraint,
-      handle:      options.handle };
-
-    if(options.starteffect)
-      options_for_draggable.starteffect = options.starteffect;
-
-    if(options.reverteffect)
-      options_for_draggable.reverteffect = options.reverteffect;
-    else
-      if(options.ghosting) options_for_draggable.reverteffect = function(element) {
-        element.style.top  = 0;
-        element.style.left = 0;
-      };
-
-    if(options.endeffect)
-      options_for_draggable.endeffect = options.endeffect;
-
-    if(options.zindex)
-      options_for_draggable.zindex = options.zindex;
-
-    // build options for the droppables  
-    var options_for_droppable = {
-      overlap:     options.overlap,
-      containment: options.containment,
-      tree:        options.tree,
-      hoverclass:  options.hoverclass,
-      onHover:     Sortable.onHover
-      //greedy:      !options.dropOnEmpty
-    }
-    
-    var options_for_tree = {
-      onHover:      Sortable.onEmptyHover,
-      overlap:      options.overlap,
-      containment:  options.containment,
-      hoverclass:   options.hoverclass
-    }
-
-    // fix for gecko engine
-    Element.cleanWhitespace(element); 
-
-    options.draggables = [];
-    options.droppables = [];
-
-    // drop on empty handling
-    if(options.dropOnEmpty || options.tree) {
-      Droppables.add(element, options_for_tree);
-      options.droppables.push(element);
-    }
-
-    (this.findElements(element, options) || []).each( function(e) {
-      // handles are per-draggable
-      var handle = options.handle ? 
-        Element.childrenWithClassName(e, options.handle)[0] : e;    
-      options.draggables.push(
-        new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
-      Droppables.add(e, options_for_droppable);
-      if(options.tree) e.treeNode = element;
-      options.droppables.push(e);      
-    });
-    
-    if(options.tree) {
-      (Sortable.findTreeElements(element, options) || []).each( function(e) {
-        Droppables.add(e, options_for_tree);
-        e.treeNode = element;
-        options.droppables.push(e);
-      });
-    }
-
-    // keep reference
-    this.sortables[element.id] = options;
-
-    // for onupdate
-    Draggables.addObserver(new SortableObserver(element, options.onUpdate));
-
-  },
-
-  // return all suitable-for-sortable elements in a guaranteed order
-  findElements: function(element, options) {
-    return Element.findChildren(
-      element, options.only, options.tree ? true : false, options.tag);
-  },
-  
-  findTreeElements: function(element, options) {
-    return Element.findChildren(
-      element, options.only, options.tree ? true : false, options.treeTag);
-  },
-
-  onHover: function(element, dropon, overlap) {
-    if(Element.isParent(dropon, element)) return;
-
-    if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) {
-      return;
-    } else if(overlap>0.5) {
-      Sortable.mark(dropon, 'before');
-      if(dropon.previousSibling != element) {
-        var oldParentNode = element.parentNode;
-        element.style.visibility = "hidden"; // fix gecko rendering
-        dropon.parentNode.insertBefore(element, dropon);
-        if(dropon.parentNode!=oldParentNode) 
-          Sortable.options(oldParentNode).onChange(element);
-        Sortable.options(dropon.parentNode).onChange(element);
-      }
-    } else {
-      Sortable.mark(dropon, 'after');
-      var nextElement = dropon.nextSibling || null;
-      if(nextElement != element) {
-        var oldParentNode = element.parentNode;
-        element.style.visibility = "hidden"; // fix gecko rendering
-        dropon.parentNode.insertBefore(element, nextElement);
-        if(dropon.parentNode!=oldParentNode) 
-          Sortable.options(oldParentNode).onChange(element);
-        Sortable.options(dropon.parentNode).onChange(element);
-      }
-    }
-  },
-  
-  onEmptyHover: function(element, dropon, overlap) {
-    var oldParentNode = element.parentNode;
-    var droponOptions = Sortable.options(dropon);
-        
-    if(!Element.isParent(dropon, element)) {
-      var index;
-      
-      var children = Sortable.findElements(dropon, {tag: droponOptions.tag});
-      var child = null;
-            
-      if(children) {
-        var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
-        
-        for (index = 0; index < children.length; index += 1) {
-          if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
-            offset -= Element.offsetSize (children[index], droponOptions.overlap);
-          } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) {
-            child = index + 1 < children.length ? children[index + 1] : null;
-            break;
-          } else {
-            child = children[index];
-            break;
-          }
-        }
-      }
-      
-      dropon.insertBefore(element, child);
-      
-      Sortable.options(oldParentNode).onChange(element);
-      droponOptions.onChange(element);
-    }
-  },
-
-  unmark: function() {
-    if(Sortable._marker) Element.hide(Sortable._marker);
-  },
-
-  mark: function(dropon, position) {
-    // mark on ghosting only
-    var sortable = Sortable.options(dropon.parentNode);
-    if(sortable && !sortable.ghosting) return; 
-
-    if(!Sortable._marker) {
-      Sortable._marker = $PR('dropmarker') || document.createElement('DIV');
-      Element.hide(Sortable._marker);
-      Element.addClassName(Sortable._marker, 'dropmarker');
-      Sortable._marker.style.position = 'absolute';
-      document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
-    }    
-    var offsets = Position.cumulativeOffset(dropon);
-    Sortable._marker.style.left = offsets[0] + 'px';
-    Sortable._marker.style.top = offsets[1] + 'px';
-    
-    if(position=='after')
-      if(sortable.overlap == 'horizontal') 
-        Sortable._marker.style.left = (offsets[0]+dropon.clientWidth) + 'px';
-      else
-        Sortable._marker.style.top = (offsets[1]+dropon.clientHeight) + 'px';
-    
-    Element.show(Sortable._marker);
-  },
-  
-  _tree: function(element, options, parent) {
-    var children = Sortable.findElements(element, options) || [];
-  
-    for (var i = 0; i < children.length; ++i) {
-      var match = children[i].id.match(options.format);
-
-      if (!match) continue;
-      
-      var child = {
-        id: encodeURIComponent(match ? match[1] : null),
-        element: element,
-        parent: parent,
-        children: new Array,
-        position: parent.children.length,
-        container: Sortable._findChildrenElement(children[i], options.treeTag.toUpperCase())
-      }
-      
-      /* Get the element containing the children and recurse over it */
-      if (child.container)
-        this._tree(child.container, options, child)
-      
-      parent.children.push (child);
-    }
-
-    return parent; 
-  },
-
-  /* Finds the first element of the given tag type within a parent element.
-    Used for finding the first LI[ST] within a L[IST]I[TEM].*/
-  _findChildrenElement: function (element, containerTag) {
-    if (element && element.hasChildNodes)
-      for (var i = 0; i < element.childNodes.length; ++i)
-        if (element.childNodes[i].tagName == containerTag)
-          return element.childNodes[i];
-  
-    return null;
-  },
-
-  tree: function(element) {
-    element = $PR(element);
-    var sortableOptions = this.options(element);
-    var options = Object.extend({
-      tag: sortableOptions.tag,
-      treeTag: sortableOptions.treeTag,
-      only: sortableOptions.only,
-      name: element.id,
-      format: sortableOptions.format
-    }, arguments[1] || {});
-    
-    var root = {
-      id: null,
-      parent: null,
-      children: new Array,
-      container: element,
-      position: 0
-    }
-    
-    return Sortable._tree (element, options, root);
-  },
-
-  /* Construct a [i] index for a particular node */
-  _constructIndex: function(node) {
-    var index = '';
-    do {
-      if (node.id) index = '[' + node.position + ']' + index;
-    } while ((node = node.parent) != null);
-    return index;
-  },
-
-  sequence: function(element) {
-    element = $PR(element);
-    var options = Object.extend(this.options(element), arguments[1] || {});
-    
-    return $PR(this.findElements(element, options) || []).map( function(item) {
-      return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
-    });
-  },
-
-  setSequence: function(element, new_sequence) {
-    element = $PR(element);
-    var options = Object.extend(this.options(element), arguments[2] || {});
-    
-    var nodeMap = {};
-    this.findElements(element, options).each( function(n) {
-        if (n.id.match(options.format))
-            nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
-        n.parentNode.removeChild(n);
-    });
-   
-    new_sequence.each(function(ident) {
-      var n = nodeMap[ident];
-      if (n) {
-        n[1].appendChild(n[0]);
-        delete nodeMap[ident];
-      }
-    });
-  },
-  
-  serialize: function(element) {
-    element = $PR(element);
-    var options = Object.extend(Sortable.options(element), arguments[1] || {});
-    var name = encodeURIComponent(
-      (arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
-    
-    if (options.tree) {
-      return Sortable.tree(element, arguments[1]).children.map( function (item) {
-        return [name + Sortable._constructIndex(item) + "=" + 
-                encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
-      }).flatten().join('&');
-    } else {
-      return Sortable.sequence(element, arguments[1]).map( function(item) {
-        return name + "[]=" + encodeURIComponent(item);
-      }).join('&');
-    }
-  }
-}
-
-/* Returns true if child is contained within element */
-Element.isParent = function(child, element) {
-  if (!child.parentNode || child == element) return false;
-
-  if (child.parentNode == element) return true;
-
-  return Element.isParent(child.parentNode, element);
-}
-
-Element.findChildren = function(element, only, recursive, tagName) {    
-  if(!element.hasChildNodes()) return null;
-  tagName = tagName.toUpperCase();
-  if(only) only = [only].flatten();
-  var elements = [];
-  $A(element.childNodes).each( function(e) {
-    if(e.tagName && e.tagName.toUpperCase()==tagName &&
-      (!only || (Element.classNames(e).detect(function(v) { return only.include(v) }))))
-        elements.push(e);
-    if(recursive) {
-      var grandchildren = Element.findChildren(e, only, recursive, tagName);
-      if(grandchildren) elements.push(grandchildren);
-    }
-  });
-
-  return (elements.length>0 ? elements.flatten() : []);
-}
-
-Element.offsetSize = function (element, type) {
-  if (type == 'vertical' || type == 'height')
-    return element.offsetHeight;
-  else
-    return element.offsetWidth;
-}
diff --git a/view/js/cropper/lib/effects.js b/view/js/cropper/lib/effects.js
deleted file mode 100644 (file)
index 7e0407d..0000000
+++ /dev/null
@@ -1,958 +0,0 @@
-// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-// Contributors:
-//  Justin Palmer (http://encytemedia.com/)
-//  Mark Pilgrim (http://diveintomark.org/)
-//  Martin Bialasinki
-// 
-// See scriptaculous.js for full license.  
-
-// converts rgb() and #xxx to #xxxxxx format,  
-// returns self (or first argument) if not convertable  
-String.prototype.parseColor = function() {  
-  var color = '#';  
-  if(this.slice(0,4) == 'rgb(') {  
-    var cols = this.slice(4,this.length-1).split(',');  
-    var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);  
-  } else {  
-    if(this.slice(0,1) == '#') {  
-      if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();  
-      if(this.length==7) color = this.toLowerCase();  
-    }  
-  }  
-  return(color.length==7 ? color : (arguments[0] || this));  
-}
-
-/*--------------------------------------------------------------------------*/
-
-Element.collectTextNodes = function(element) {  
-  return $A($PR(element).childNodes).collect( function(node) {
-    return (node.nodeType==3 ? node.nodeValue : 
-      (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
-  }).flatten().join('');
-}
-
-Element.collectTextNodesIgnoreClass = function(element, className) {  
-  return $A($PR(element).childNodes).collect( function(node) {
-    return (node.nodeType==3 ? node.nodeValue : 
-      ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? 
-        Element.collectTextNodesIgnoreClass(node, className) : ''));
-  }).flatten().join('');
-}
-
-Element.setContentZoom = function(element, percent) {
-  element = $PR(element);  
-  Element.setStyle(element, {fontSize: (percent/100) + 'em'});   
-  if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);
-}
-
-Element.getOpacity = function(element){  
-  var opacity;
-  if (opacity = Element.getStyle(element, 'opacity'))  
-    return parseFloat(opacity);  
-  if (opacity = (Element.getStyle(element, 'filter') || '').match(/alpha\(opacity=(.*)\)/))  
-    if(opacity[1]) return parseFloat(opacity[1]) / 100;  
-  return 1.0;  
-}
-
-Element.setOpacity = function(element, value){  
-  element= $PR(element);  
-  if (value == 1){
-    Element.setStyle(element, { opacity: 
-      (/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 
-      0.999999 : null });
-    if(/MSIE/.test(navigator.userAgent))  
-      Element.setStyle(element, {filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')});  
-  } else {  
-    if(value < 0.00001) value = 0;  
-    Element.setStyle(element, {opacity: value});
-    if(/MSIE/.test(navigator.userAgent))  
-     Element.setStyle(element, 
-       { filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'') +
-                 'alpha(opacity='+value*100+')' });  
-  }
-}  
-Element.getInlineOpacity = function(element){  
-  return $PR(element).style.opacity || '';
-}  
-
-Element.childrenWithClassName = function(element, className, findFirst) {
-  var classNameRegExp = new RegExp("(^|\\s)" + className + "(\\s|$)");
-  var results = $A($PR(element).getElementsByTagName('*'))[findFirst ? 'detect' : 'select']( function(c) { 
-    return (c.className && c.className.match(classNameRegExp));
-  });
-  if(!results) results = [];
-  return results;
-}
-
-Element.forceRerendering = function(element) {
-  try {
-    element = $PR(element);
-    var n = document.createTextNode(' ');
-    element.appendChild(n);
-    element.removeChild(n);
-  } catch(e) { }
-};
-
-/*--------------------------------------------------------------------------*/
-
-Array.prototype.call = function() {
-  var args = arguments;
-  this.each(function(f){ f.apply(this, args) });
-}
-
-/*--------------------------------------------------------------------------*/
-
-var Effect = {
-  tagifyText: function(element) {
-    var tagifyStyle = 'position:relative';
-    if(/MSIE/.test(navigator.userAgent)) tagifyStyle += ';zoom:1';
-    element = $PR(element);
-    $A(element.childNodes).each( function(child) {
-      if(child.nodeType==3) {
-        child.nodeValue.toArray().each( function(character) {
-          element.insertBefore(
-            Builder.node('span',{style: tagifyStyle},
-              character == ' ' ? String.fromCharCode(160) : character), 
-              child);
-        });
-        Element.remove(child);
-      }
-    });
-  },
-  multiple: function(element, effect) {
-    var elements;
-    if(((typeof element == 'object') || 
-        (typeof element == 'function')) && 
-       (element.length))
-      elements = element;
-    else
-      elements = $PR(element).childNodes;
-      
-    var options = Object.extend({
-      speed: 0.1,
-      delay: 0.0
-    }, arguments[2] || {});
-    var masterDelay = options.delay;
-
-    $A(elements).each( function(element, index) {
-      new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));
-    });
-  },
-  PAIRS: {
-    'slide':  ['SlideDown','SlideUp'],
-    'blind':  ['BlindDown','BlindUp'],
-    'appear': ['Appear','Fade']
-  },
-  toggle: function(element, effect) {
-    element = $PR(element);
-    effect = (effect || 'appear').toLowerCase();
-    var options = Object.extend({
-      queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
-    }, arguments[2] || {});
-    Effect[element.visible() ? 
-      Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
-  }
-};
-
-var Effect2 = Effect; // deprecated
-
-/* ------------- transitions ------------- */
-
-Effect.Transitions = {}
-
-Effect.Transitions.linear = function(pos) {
-  return pos;
-}
-Effect.Transitions.sinoidal = function(pos) {
-  return (-Math.cos(pos*Math.PI)/2) + 0.5;
-}
-Effect.Transitions.reverse  = function(pos) {
-  return 1-pos;
-}
-Effect.Transitions.flicker = function(pos) {
-  return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
-}
-Effect.Transitions.wobble = function(pos) {
-  return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
-}
-Effect.Transitions.pulse = function(pos) {
-  return (Math.floor(pos*10) % 2 == 0 ? 
-    (pos*10-Math.floor(pos*10)) : 1-(pos*10-Math.floor(pos*10)));
-}
-Effect.Transitions.none = function(pos) {
-  return 0;
-}
-Effect.Transitions.full = function(pos) {
-  return 1;
-}
-
-/* ------------- core effects ------------- */
-
-Effect.ScopedQueue = Class.create();
-Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {
-  initialize: function() {
-    this.effects  = [];
-    this.interval = null;
-  },
-  _each: function(iterator) {
-    this.effects._each(iterator);
-  },
-  add: function(effect) {
-    var timestamp = new Date().getTime();
-    
-    var position = (typeof effect.options.queue == 'string') ? 
-      effect.options.queue : effect.options.queue.position;
-    
-    switch(position) {
-      case 'front':
-        // move unstarted effects after this effect  
-        this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
-            e.startOn  += effect.finishOn;
-            e.finishOn += effect.finishOn;
-          });
-        break;
-      case 'end':
-        // start effect after last queued effect has finished
-        timestamp = this.effects.pluck('finishOn').max() || timestamp;
-        break;
-    }
-    
-    effect.startOn  += timestamp;
-    effect.finishOn += timestamp;
-
-    if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
-      this.effects.push(effect);
-    
-    if(!this.interval) 
-      this.interval = setInterval(this.loop.bind(this), 40);
-  },
-  remove: function(effect) {
-    this.effects = this.effects.reject(function(e) { return e==effect });
-    if(this.effects.length == 0) {
-      clearInterval(this.interval);
-      this.interval = null;
-    }
-  },
-  loop: function() {
-    var timePos = new Date().getTime();
-    this.effects.invoke('loop', timePos);
-  }
-});
-
-Effect.Queues = {
-  instances: $H(),
-  get: function(queueName) {
-    if(typeof queueName != 'string') return queueName;
-    
-    if(!this.instances[queueName])
-      this.instances[queueName] = new Effect.ScopedQueue();
-      
-    return this.instances[queueName];
-  }
-}
-Effect.Queue = Effect.Queues.get('global');
-
-Effect.DefaultOptions = {
-  transition: Effect.Transitions.sinoidal,
-  duration:   1.0,   // seconds
-  fps:        25.0,  // max. 25fps due to Effect.Queue implementation
-  sync:       false, // true for combining
-  from:       0.0,
-  to:         1.0,
-  delay:      0.0,
-  queue:      'parallel'
-}
-
-Effect.Base = function() {};
-Effect.Base.prototype = {
-  position: null,
-  start: function(options) {
-    this.options      = Object.extend(Object.extend({},Effect.DefaultOptions), options || {});
-    this.currentFrame = 0;
-    this.state        = 'idle';
-    this.startOn      = this.options.delay*1000;
-    this.finishOn     = this.startOn + (this.options.duration*1000);
-    this.event('beforeStart');
-    if(!this.options.sync)
-      Effect.Queues.get(typeof this.options.queue == 'string' ? 
-        'global' : this.options.queue.scope).add(this);
-  },
-  loop: function(timePos) {
-    if(timePos >= this.startOn) {
-      if(timePos >= this.finishOn) {
-        this.render(1.0);
-        this.cancel();
-        this.event('beforeFinish');
-        if(this.finish) this.finish(); 
-        this.event('afterFinish');
-        return;  
-      }
-      var pos   = (timePos - this.startOn) / (this.finishOn - this.startOn);
-      var frame = Math.round(pos * this.options.fps * this.options.duration);
-      if(frame > this.currentFrame) {
-        this.render(pos);
-        this.currentFrame = frame;
-      }
-    }
-  },
-  render: function(pos) {
-    if(this.state == 'idle') {
-      this.state = 'running';
-      this.event('beforeSetup');
-      if(this.setup) this.setup();
-      this.event('afterSetup');
-    }
-    if(this.state == 'running') {
-      if(this.options.transition) pos = this.options.transition(pos);
-      pos *= (this.options.to-this.options.from);
-      pos += this.options.from;
-      this.position = pos;
-      this.event('beforeUpdate');
-      if(this.update) this.update(pos);
-      this.event('afterUpdate');
-    }
-  },
-  cancel: function() {
-    if(!this.options.sync)
-      Effect.Queues.get(typeof this.options.queue == 'string' ? 
-        'global' : this.options.queue.scope).remove(this);
-    this.state = 'finished';
-  },
-  event: function(eventName) {
-    if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this);
-    if(this.options[eventName]) this.options[eventName](this);
-  },
-  inspect: function() {
-    return '#<Effect:' + $H(this).inspect() + ',options:' + $H(this.options).inspect() + '>';
-  }
-}
-
-Effect.Parallel = Class.create();
-Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), {
-  initialize: function(effects) {
-    this.effects = effects || [];
-    this.start(arguments[1]);
-  },
-  update: function(position) {
-    this.effects.invoke('render', position);
-  },
-  finish: function(position) {
-    this.effects.each( function(effect) {
-      effect.render(1.0);
-      effect.cancel();
-      effect.event('beforeFinish');
-      if(effect.finish) effect.finish(position);
-      effect.event('afterFinish');
-    });
-  }
-});
-
-Effect.Opacity = Class.create();
-Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {
-  initialize: function(element) {
-    this.element = $PR(element);
-    // make this work on IE on elements without 'layout'
-    if(/MSIE/.test(navigator.userAgent) && (!this.element.hasLayout))
-      this.element.setStyle({zoom: 1});
-    var options = Object.extend({
-      from: this.element.getOpacity() || 0.0,
-      to:   1.0
-    }, arguments[1] || {});
-    this.start(options);
-  },
-  update: function(position) {
-    this.element.setOpacity(position);
-  }
-});
-
-Effect.Move = Class.create();
-Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), {
-  initialize: function(element) {
-    this.element = $PR(element);
-    var options = Object.extend({
-      x:    0,
-      y:    0,
-      mode: 'relative'
-    }, arguments[1] || {});
-    this.start(options);
-  },
-  setup: function() {
-    // Bug in Opera: Opera returns the "real" position of a static element or
-    // relative element that does not have top/left explicitly set.
-    // ==> Always set top and left for position relative elements in your stylesheets 
-    // (to 0 if you do not need them) 
-    this.element.makePositioned();
-    this.originalLeft = parseFloat(this.element.getStyle('left') || '0');
-    this.originalTop  = parseFloat(this.element.getStyle('top')  || '0');
-    if(this.options.mode == 'absolute') {
-      // absolute movement, so we need to calc deltaX and deltaY
-      this.options.x = this.options.x - this.originalLeft;
-      this.options.y = this.options.y - this.originalTop;
-    }
-  },
-  update: function(position) {
-    this.element.setStyle({
-      left: this.options.x  * position + this.originalLeft + 'px',
-      top:  this.options.y  * position + this.originalTop  + 'px'
-    });
-  }
-});
-
-// for backwards compatibility
-Effect.MoveBy = function(element, toTop, toLeft) {
-  return new Effect.Move(element, 
-    Object.extend({ x: toLeft, y: toTop }, arguments[3] || {}));
-};
-
-Effect.Scale = Class.create();
-Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), {
-  initialize: function(element, percent) {
-    this.element = $PR(element)
-    var options = Object.extend({
-      scaleX: true,
-      scaleY: true,
-      scaleContent: true,
-      scaleFromCenter: false,
-      scaleMode: 'box',        // 'box' or 'contents' or {} with provided values
-      scaleFrom: 100.0,
-      scaleTo:   percent
-    }, arguments[2] || {});
-    this.start(options);
-  },
-  setup: function() {
-    this.restoreAfterFinish = this.options.restoreAfterFinish || false;
-    this.elementPositioning = this.element.getStyle('position');
-    
-    this.originalStyle = {};
-    ['top','left','width','height','fontSize'].each( function(k) {
-      this.originalStyle[k] = this.element.style[k];
-    }.bind(this));
-      
-    this.originalTop  = this.element.offsetTop;
-    this.originalLeft = this.element.offsetLeft;
-    
-    var fontSize = this.element.getStyle('font-size') || '100%';
-    ['em','px','%'].each( function(fontSizeType) {
-      if(fontSize.indexOf(fontSizeType)>0) {
-        this.fontSize     = parseFloat(fontSize);
-        this.fontSizeType = fontSizeType;
-      }
-    }.bind(this));
-    
-    this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
-    
-    this.dims = null;
-    if(this.options.scaleMode=='box')
-      this.dims = [this.element.offsetHeight, this.element.offsetWidth];
-    if(/^content/.test(this.options.scaleMode))
-      this.dims = [this.element.scrollHeight, this.element.scrollWidth];
-    if(!this.dims)
-      this.dims = [this.options.scaleMode.originalHeight,
-                   this.options.scaleMode.originalWidth];
-  },
-  update: function(position) {
-    var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
-    if(this.options.scaleContent && this.fontSize)
-      this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
-    this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
-  },
-  finish: function(position) {
-    if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
-  },
-  setDimensions: function(height, width) {
-    var d = {};
-    if(this.options.scaleX) d.width = width + 'px';
-    if(this.options.scaleY) d.height = height + 'px';
-    if(this.options.scaleFromCenter) {
-      var topd  = (height - this.dims[0])/2;
-      var leftd = (width  - this.dims[1])/2;
-      if(this.elementPositioning == 'absolute') {
-        if(this.options.scaleY) d.top = this.originalTop-topd + 'px';
-        if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px';
-      } else {
-        if(this.options.scaleY) d.top = -topd + 'px';
-        if(this.options.scaleX) d.left = -leftd + 'px';
-      }
-    }
-    this.element.setStyle(d);
-  }
-});
-
-Effect.Highlight = Class.create();
-Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), {
-  initialize: function(element) {
-    this.element = $PR(element);
-    var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {});
-    this.start(options);
-  },
-  setup: function() {
-    // Prevent executing on elements not in the layout flow
-    if(this.element.getStyle('display')=='none') { this.cancel(); return; }
-    // Disable background image during the effect
-    this.oldStyle = {
-      backgroundImage: this.element.getStyle('background-image') };
-    this.element.setStyle({backgroundImage: 'none'});
-    if(!this.options.endcolor)
-      this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
-    if(!this.options.restorecolor)
-      this.options.restorecolor = this.element.getStyle('background-color');
-    // init color calculations
-    this._base  = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
-    this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
-  },
-  update: function(position) {
-    this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
-      return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) });
-  },
-  finish: function() {
-    this.element.setStyle(Object.extend(this.oldStyle, {
-      backgroundColor: this.options.restorecolor
-    }));
-  }
-});
-
-Effect.ScrollTo = Class.create();
-Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), {
-  initialize: function(element) {
-    this.element = $PR(element);
-    this.start(arguments[1] || {});
-  },
-  setup: function() {
-    Position.prepare();
-    var offsets = Position.cumulativeOffset(this.element);
-    if(this.options.offset) offsets[1] += this.options.offset;
-    var max = window.innerHeight ? 
-      window.height - window.innerHeight :
-      document.body.scrollHeight - 
-        (document.documentElement.clientHeight ? 
-          document.documentElement.clientHeight : document.body.clientHeight);
-    this.scrollStart = Position.deltaY;
-    this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart;
-  },
-  update: function(position) {
-    Position.prepare();
-    window.scrollTo(Position.deltaX, 
-      this.scrollStart + (position*this.delta));
-  }
-});
-
-/* ------------- combination effects ------------- */
-
-Effect.Fade = function(element) {
-  element = $PR(element);
-  var oldOpacity = element.getInlineOpacity();
-  var options = Object.extend({
-  from: element.getOpacity() || 1.0,
-  to:   0.0,
-  afterFinishInternal: function(effect) { 
-    if(effect.options.to!=0) return;
-    effect.element.hide();
-    effect.element.setStyle({opacity: oldOpacity}); 
-  }}, arguments[1] || {});
-  return new Effect.Opacity(element,options);
-}
-
-Effect.Appear = function(element) {
-  element = $PR(element);
-  var options = Object.extend({
-  from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
-  to:   1.0,
-  // force Safari to render floated elements properly
-  afterFinishInternal: function(effect) {
-    effect.element.forceRerendering();
-  },
-  beforeSetup: function(effect) {
-    effect.element.setOpacity(effect.options.from);
-    effect.element.show(); 
-  }}, arguments[1] || {});
-  return new Effect.Opacity(element,options);
-}
-
-Effect.Puff = function(element) {
-  element = $PR(element);
-  var oldStyle = { opacity: element.getInlineOpacity(), position: element.getStyle('position') };
-  return new Effect.Parallel(
-   [ new Effect.Scale(element, 200, 
-      { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), 
-     new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], 
-     Object.extend({ duration: 1.0, 
-      beforeSetupInternal: function(effect) {
-        effect.effects[0].element.setStyle({position: 'absolute'}); },
-      afterFinishInternal: function(effect) {
-         effect.effects[0].element.hide();
-         effect.effects[0].element.setStyle(oldStyle); }
-     }, arguments[1] || {})
-   );
-}
-
-Effect.BlindUp = function(element) {
-  element = $PR(element);
-  element.makeClipping();
-  return new Effect.Scale(element, 0, 
-    Object.extend({ scaleContent: false, 
-      scaleX: false, 
-      restoreAfterFinish: true,
-      afterFinishInternal: function(effect) {
-        effect.element.hide();
-        effect.element.undoClipping();
-      } 
-    }, arguments[1] || {})
-  );
-}
-
-Effect.BlindDown = function(element) {
-  element = $PR(element);
-  var elementDimensions = element.getDimensions();
-  return new Effect.Scale(element, 100, 
-    Object.extend({ scaleContent: false, 
-      scaleX: false,
-      scaleFrom: 0,
-      scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
-      restoreAfterFinish: true,
-      afterSetup: function(effect) {
-        effect.element.makeClipping();
-        effect.element.setStyle({height: '0px'});
-        effect.element.show(); 
-      },  
-      afterFinishInternal: function(effect) {
-        effect.element.undoClipping();
-      }
-    }, arguments[1] || {})
-  );
-}
-
-Effect.SwitchOff = function(element) {
-  element = $PR(element);
-  var oldOpacity = element.getInlineOpacity();
-  return new Effect.Appear(element, { 
-    duration: 0.4,
-    from: 0,
-    transition: Effect.Transitions.flicker,
-    afterFinishInternal: function(effect) {
-      new Effect.Scale(effect.element, 1, { 
-        duration: 0.3, scaleFromCenter: true,
-        scaleX: false, scaleContent: false, restoreAfterFinish: true,
-        beforeSetup: function(effect) { 
-          effect.element.makePositioned();
-          effect.element.makeClipping();
-        },
-        afterFinishInternal: function(effect) {
-          effect.element.hide();
-          effect.element.undoClipping();
-          effect.element.undoPositioned();
-          effect.element.setStyle({opacity: oldOpacity});
-        }
-      })
-    }
-  });
-}
-
-Effect.DropOut = function(element) {
-  element = $PR(element);
-  var oldStyle = {
-    top: element.getStyle('top'),
-    left: element.getStyle('left'),
-    opacity: element.getInlineOpacity() };
-  return new Effect.Parallel(
-    [ new Effect.Move(element, {x: 0, y: 100, sync: true }), 
-      new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
-    Object.extend(
-      { duration: 0.5,
-        beforeSetup: function(effect) {
-          effect.effects[0].element.makePositioned(); 
-        },
-        afterFinishInternal: function(effect) {
-          effect.effects[0].element.hide();
-          effect.effects[0].element.undoPositioned();
-          effect.effects[0].element.setStyle(oldStyle);
-        } 
-      }, arguments[1] || {}));
-}
-
-Effect.Shake = function(element) {
-  element = $PR(element);
-  var oldStyle = {
-    top: element.getStyle('top'),
-    left: element.getStyle('left') };
-    return new Effect.Move(element, 
-      { x:  20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x: -40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x:  40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x: -40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x:  40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
-        effect.element.undoPositioned();
-        effect.element.setStyle(oldStyle);
-  }}) }}) }}) }}) }}) }});
-}
-
-Effect.SlideDown = function(element) {
-  element = $PR(element);
-  element.cleanWhitespace();
-  // SlideDown need to have the content of the element wrapped in a container element with fixed height!
-  var oldInnerBottom = $PR(element.firstChild).getStyle('bottom');
-  var elementDimensions = element.getDimensions();
-  return new Effect.Scale(element, 100, Object.extend({ 
-    scaleContent: false, 
-    scaleX: false, 
-    scaleFrom: window.opera ? 0 : 1,
-    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
-    restoreAfterFinish: true,
-    afterSetup: function(effect) {
-      effect.element.makePositioned();
-      effect.element.firstChild.makePositioned();
-      if(window.opera) effect.element.setStyle({top: ''});
-      effect.element.makeClipping();
-      effect.element.setStyle({height: '0px'});
-      effect.element.show(); },
-    afterUpdateInternal: function(effect) {
-      effect.element.firstChild.setStyle({bottom:
-        (effect.dims[0] - effect.element.clientHeight) + 'px' }); 
-    },
-    afterFinishInternal: function(effect) {
-      effect.element.undoClipping(); 
-      // IE will crash if child is undoPositioned first
-      if(/MSIE/.test(navigator.userAgent)){
-        effect.element.undoPositioned();
-        effect.element.firstChild.undoPositioned();
-      }else{
-        effect.element.firstChild.undoPositioned();
-        effect.element.undoPositioned();
-      }
-      effect.element.firstChild.setStyle({bottom: oldInnerBottom}); }
-    }, arguments[1] || {})
-  );
-}
-  
-Effect.SlideUp = function(element) {
-  element = $PR(element);
-  element.cleanWhitespace();
-  var oldInnerBottom = $PR(element.firstChild).getStyle('bottom');
-  return new Effect.Scale(element, window.opera ? 0 : 1,
-   Object.extend({ scaleContent: false, 
-    scaleX: false, 
-    scaleMode: 'box',
-    scaleFrom: 100,
-    restoreAfterFinish: true,
-    beforeStartInternal: function(effect) {
-      effect.element.makePositioned();
-      effect.element.firstChild.makePositioned();
-      if(window.opera) effect.element.setStyle({top: ''});
-      effect.element.makeClipping();
-      effect.element.show(); },  
-    afterUpdateInternal: function(effect) {
-      effect.element.firstChild.setStyle({bottom:
-        (effect.dims[0] - effect.element.clientHeight) + 'px' }); },
-    afterFinishInternal: function(effect) {
-      effect.element.hide();
-      effect.element.undoClipping();
-      effect.element.firstChild.undoPositioned();
-      effect.element.undoPositioned();
-      effect.element.setStyle({bottom: oldInnerBottom}); }
-   }, arguments[1] || {})
-  );
-}
-
-// Bug in opera makes the TD containing this element expand for a instance after finish 
-Effect.Squish = function(element) {
-  return new Effect.Scale(element, window.opera ? 1 : 0, 
-    { restoreAfterFinish: true,
-      beforeSetup: function(effect) {
-        effect.element.makeClipping(effect.element); },  
-      afterFinishInternal: function(effect) {
-        effect.element.hide(effect.element); 
-        effect.element.undoClipping(effect.element); }
-  });
-}
-
-Effect.Grow = function(element) {
-  element = $PR(element);
-  var options = Object.extend({
-    direction: 'center',
-    moveTransition: Effect.Transitions.sinoidal,
-    scaleTransition: Effect.Transitions.sinoidal,
-    opacityTransition: Effect.Transitions.full
-  }, arguments[1] || {});
-  var oldStyle = {
-    top: element.style.top,
-    left: element.style.left,
-    height: element.style.height,
-    width: element.style.width,
-    opacity: element.getInlineOpacity() };
-
-  var dims = element.getDimensions();    
-  var initialMoveX, initialMoveY;
-  var moveX, moveY;
-  
-  switch (options.direction) {
-    case 'top-left':
-      initialMoveX = initialMoveY = moveX = moveY = 0; 
-      break;
-    case 'top-right':
-      initialMoveX = dims.width;
-      initialMoveY = moveY = 0;
-      moveX = -dims.width;
-      break;
-    case 'bottom-left':
-      initialMoveX = moveX = 0;
-      initialMoveY = dims.height;
-      moveY = -dims.height;
-      break;
-    case 'bottom-right':
-      initialMoveX = dims.width;
-      initialMoveY = dims.height;
-      moveX = -dims.width;
-      moveY = -dims.height;
-      break;
-    case 'center':
-      initialMoveX = dims.width / 2;
-      initialMoveY = dims.height / 2;
-      moveX = -dims.width / 2;
-      moveY = -dims.height / 2;
-      break;
-  }
-  
-  return new Effect.Move(element, {
-    x: initialMoveX,
-    y: initialMoveY,
-    duration: 0.01, 
-    beforeSetup: function(effect) {
-      effect.element.hide();
-      effect.element.makeClipping();
-      effect.element.makePositioned();
-    },
-    afterFinishInternal: function(effect) {
-      new Effect.Parallel(
-        [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
-          new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
-          new Effect.Scale(effect.element, 100, {
-            scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, 
-            sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
-        ], Object.extend({
-             beforeSetup: function(effect) {
-               effect.effects[0].element.setStyle({height: '0px'});
-               effect.effects[0].element.show(); 
-             },
-             afterFinishInternal: function(effect) {
-               effect.effects[0].element.undoClipping();
-               effect.effects[0].element.undoPositioned();
-               effect.effects[0].element.setStyle(oldStyle); 
-             }
-           }, options)
-      )
-    }
-  });
-}
-
-Effect.Shrink = function(element) {
-  element = $PR(element);
-  var options = Object.extend({
-    direction: 'center',
-    moveTransition: Effect.Transitions.sinoidal,
-    scaleTransition: Effect.Transitions.sinoidal,
-    opacityTransition: Effect.Transitions.none
-  }, arguments[1] || {});
-  var oldStyle = {
-    top: element.style.top,
-    left: element.style.left,
-    height: element.style.height,
-    width: element.style.width,
-    opacity: element.getInlineOpacity() };
-
-  var dims = element.getDimensions();
-  var moveX, moveY;
-  
-  switch (options.direction) {
-    case 'top-left':
-      moveX = moveY = 0;
-      break;
-    case 'top-right':
-      moveX = dims.width;
-      moveY = 0;
-      break;
-    case 'bottom-left':
-      moveX = 0;
-      moveY = dims.height;
-      break;
-    case 'bottom-right':
-      moveX = dims.width;
-      moveY = dims.height;
-      break;
-    case 'center':  
-      moveX = dims.width / 2;
-      moveY = dims.height / 2;
-      break;
-  }
-  
-  return new Effect.Parallel(
-    [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
-      new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
-      new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
-    ], Object.extend({            
-         beforeStartInternal: function(effect) {
-           effect.effects[0].element.makePositioned();
-           effect.effects[0].element.makeClipping(); },
-         afterFinishInternal: function(effect) {
-           effect.effects[0].element.hide();
-           effect.effects[0].element.undoClipping();
-           effect.effects[0].element.undoPositioned();
-           effect.effects[0].element.setStyle(oldStyle); }
-       }, options)
-  );
-}
-
-Effect.Pulsate = function(element) {
-  element = $PR(element);
-  var options    = arguments[1] || {};
-  var oldOpacity = element.getInlineOpacity();
-  var transition = options.transition || Effect.Transitions.sinoidal;
-  var reverser   = function(pos){ return transition(1-Effect.Transitions.pulse(pos)) };
-  reverser.bind(transition);
-  return new Effect.Opacity(element, 
-    Object.extend(Object.extend({  duration: 3.0, from: 0,
-      afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
-    }, options), {transition: reverser}));
-}
-
-Effect.Fold = function(element) {
-  element = $PR(element);
-  var oldStyle = {
-    top: element.style.top,
-    left: element.style.left,
-    width: element.style.width,
-    height: element.style.height };
-  Element.makeClipping(element);
-  return new Effect.Scale(element, 5, Object.extend({   
-    scaleContent: false,
-    scaleX: false,
-    afterFinishInternal: function(effect) {
-    new Effect.Scale(element, 1, { 
-      scaleContent: false, 
-      scaleY: false,
-      afterFinishInternal: function(effect) {
-        effect.element.hide();
-        effect.element.undoClipping(); 
-        effect.element.setStyle(oldStyle);
-      } });
-  }}, arguments[1] || {}));
-};
-
-['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom',
- 'collectTextNodes','collectTextNodesIgnoreClass','childrenWithClassName'].each( 
-  function(f) { Element.Methods[f] = Element[f]; }
-);
-
-Element.Methods.visualEffect = function(element, effect, options) {
-  s = effect.gsub(/_/, '-').camelize();
-  effect_class = s.charAt(0).toUpperCase() + s.substring(1);
-  new Effect[effect_class](element, options);
-  return $PR(element);
-};
-
-Element.addMethods();
diff --git a/view/js/cropper/lib/prototype.js b/view/js/cropper/lib/prototype.js
deleted file mode 100644 (file)
index 6682065..0000000
+++ /dev/null
@@ -1,2006 +0,0 @@
-/*  Prototype JavaScript framework, version 1.5.0_rc0
- *  (c) 2005 Sam Stephenson <sam@conio.net>
- *
- *  Prototype is freely distributable under the terms of an MIT-style license.
- *  For details, see the Prototype web site: http://prototype.conio.net/
- *
-/*--------------------------------------------------------------------------*/
-
-var Prototype = {
-  Version: '1.5.0_rc0',
-  ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
-
-  emptyFunction: function() {},
-  K: function(x) {return x}
-}
-
-var Class = {
-  create: function() {
-    return function() {
-      this.initialize.apply(this, arguments);
-    }
-  }
-}
-
-var Abstract = new Object();
-
-Object.extend = function(destination, source) {
-  for (var property in source) {
-    destination[property] = source[property];
-  }
-  return destination;
-}
-
-Object.inspect = function(object) {
-  try {
-    if (object == undefined) return 'undefined';
-    if (object == null) return 'null';
-    return object.inspect ? object.inspect() : object.toString();
-  } catch (e) {
-    if (e instanceof RangeError) return '...';
-    throw e;
-  }
-}
-
-Function.prototype.bind = function() {
-  var __method = this, args = $A(arguments), object = args.shift();
-  return function() {
-    return __method.apply(object, args.concat($A(arguments)));
-  }
-}
-
-Function.prototype.bindAsEventListener = function(object) {
-  var __method = this;
-  return function(event) {
-    return __method.call(object, event || window.event);
-  }
-}
-
-Object.extend(Number.prototype, {
-  toColorPart: function() {
-    var digits = this.toString(16);
-    if (this < 16) return '0' + digits;
-    return digits;
-  },
-
-  succ: function() {
-    return this + 1;
-  },
-
-  times: function(iterator) {
-    $R(0, this, true).each(iterator);
-    return this;
-  }
-});
-
-var Try = {
-  these: function() {
-    var returnValue;
-
-    for (var i = 0; i < arguments.length; i++) {
-      var lambda = arguments[i];
-      try {
-        returnValue = lambda();
-        break;
-      } catch (e) {}
-    }
-
-    return returnValue;
-  }
-}
-
-/*--------------------------------------------------------------------------*/
-
-var PeriodicalExecuter = Class.create();
-PeriodicalExecuter.prototype = {
-  initialize: function(callback, frequency) {
-    this.callback = callback;
-    this.frequency = frequency;
-    this.currentlyExecuting = false;
-
-    this.registerCallback();
-  },
-
-  registerCallback: function() {
-    setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
-  },
-
-  onTimerEvent: function() {
-    if (!this.currentlyExecuting) {
-      try {
-        this.currentlyExecuting = true;
-        this.callback();
-      } finally {
-        this.currentlyExecuting = false;
-      }
-    }
-  }
-}
-Object.extend(String.prototype, {
-  gsub: function(pattern, replacement) {
-    var result = '', source = this, match;
-    replacement = arguments.callee.prepareReplacement(replacement);
-
-    while (source.length > 0) {
-      if (match = source.match(pattern)) {
-        result += source.slice(0, match.index);
-        result += (replacement(match) || '').toString();
-        source  = source.slice(match.index + match[0].length);
-      } else {
-        result += source, source = '';
-      }
-    }
-    return result;
-  },
-
-  sub: function(pattern, replacement, count) {
-    replacement = this.gsub.prepareReplacement(replacement);
-    count = count === undefined ? 1 : count;
-
-    return this.gsub(pattern, function(match) {
-      if (--count < 0) return match[0];
-      return replacement(match);
-    });
-  },
-
-  scan: function(pattern, iterator) {
-    this.gsub(pattern, iterator);
-    return this;
-  },
-
-  truncate: function(length, truncation) {
-    length = length || 30;
-    truncation = truncation === undefined ? '...' : truncation;
-    return this.length > length ?
-      this.slice(0, length - truncation.length) + truncation : this;
-  },
-
-  strip: function() {
-    return this.replace(/^\s+/, '').replace(/\s+$/, '');
-  },
-
-  stripTags: function() {
-    return this.replace(/<\/?[^>]+>/gi, '');
-  },
-
-  stripScripts: function() {
-    return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
-  },
-
-  extractScripts: function() {
-    var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
-    var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
-    return (this.match(matchAll) || []).map(function(scriptTag) {
-      return (scriptTag.match(matchOne) || ['', ''])[1];
-    });
-  },
-
-  evalScripts: function() {
-    return this.extractScripts().map(function(script) { return eval(script) });
-  },
-
-  escapeHTML: function() {
-    var div = document.createElement('div');
-    var text = document.createTextNode(this);
-    div.appendChild(text);
-    return div.innerHTML;
-  },
-
-  unescapeHTML: function() {
-    var div = document.createElement('div');
-    div.innerHTML = this.stripTags();
-    return div.childNodes[0] ? div.childNodes[0].nodeValue : '';
-  },
-
-  toQueryParams: function() {
-    var pairs = this.match(/^\??(.*)$/)[1].split('&');
-    return pairs.inject({}, function(params, pairString) {
-      var pair = pairString.split('=');
-      params[pair[0]] = pair[1];
-      return params;
-    });
-  },
-
-  toArray: function() {
-    return this.split('');
-  },
-
-  camelize: function() {
-    var oStringList = this.split('-');
-    if (oStringList.length == 1) return oStringList[0];
-
-    var camelizedString = this.indexOf('-') == 0
-      ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1)
-      : oStringList[0];
-
-    for (var i = 1, len = oStringList.length; i < len; i++) {
-      var s = oStringList[i];
-      camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
-    }
-
-    return camelizedString;
-  },
-
-  inspect: function() {
-    return "'" + this.replace(/\\/g, '\\\\').replace(/'/g, '\\\'') + "'";
-  }
-});
-
-String.prototype.gsub.prepareReplacement = function(replacement) {
-  if (typeof replacement == 'function') return replacement;
-  var template = new Template(replacement);
-  return function(match) { return template.evaluate(match) };
-}
-
-String.prototype.parseQuery = String.prototype.toQueryParams;
-
-var Template = Class.create();
-Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
-Template.prototype = {
-  initialize: function(template, pattern) {
-    this.template = template.toString();
-    this.pattern  = pattern || Template.Pattern;
-  },
-
-  evaluate: function(object) {
-    return this.template.gsub(this.pattern, function(match) {
-      var before = match[1];
-      if (before == '\\') return match[2];
-      return before + (object[match[3]] || '').toString();
-    });
-  }
-}
-
-var $break    = new Object();
-var $continue = new Object();
-
-var Enumerable = {
-  each: function(iterator) {
-    var index = 0;
-    try {
-      this._each(function(value) {
-        try {
-          iterator(value, index++);
-        } catch (e) {
-          if (e != $continue) throw e;
-        }
-      });
-    } catch (e) {
-      if (e != $break) throw e;
-    }
-  },
-
-  all: function(iterator) {
-    var result = true;
-    this.each(function(value, index) {
-      result = result && !!(iterator || Prototype.K)(value, index);
-      if (!result) throw $break;
-    });
-    return result;
-  },
-
-  any: function(iterator) {
-    var result = true;
-    this.each(function(value, index) {
-      if (result = !!(iterator || Prototype.K)(value, index))
-        throw $break;
-    });
-    return result;
-  },
-
-  collect: function(iterator) {
-    var results = [];
-    this.each(function(value, index) {
-      results.push(iterator(value, index));
-    });
-    return results;
-  },
-
-  detect: function (iterator) {
-    var result;
-    this.each(function(value, index) {
-      if (iterator(value, index)) {
-        result = value;
-        throw $break;
-      }
-    });
-    return result;
-  },
-
-  findAll: function(iterator) {
-    var results = [];
-    this.each(function(value, index) {
-      if (iterator(value, index))
-        results.push(value);
-    });
-    return results;
-  },
-
-  grep: function(pattern, iterator) {
-    var results = [];
-    this.each(function(value, index) {
-      var stringValue = value.toString();
-      if (stringValue.match(pattern))
-        results.push((iterator || Prototype.K)(value, index));
-    })
-    return results;
-  },
-
-  include: function(object) {
-    var found = false;
-    this.each(function(value) {
-      if (value == object) {
-        found = true;
-        throw $break;
-      }
-    });
-    return found;
-  },
-
-  inject: function(memo, iterator) {
-    this.each(function(value, index) {
-      memo = iterator(memo, value, index);
-    });
-    return memo;
-  },
-
-  invoke: function(method) {
-    var args = $A(arguments).slice(1);
-    return this.collect(function(value) {
-      return value[method].apply(value, args);
-    });
-  },
-
-  max: function(iterator) {
-    var result;
-    this.each(function(value, index) {
-      value = (iterator || Prototype.K)(value, index);
-      if (result == undefined || value >= result)
-        result = value;
-    });
-    return result;
-  },
-
-  min: function(iterator) {
-    var result;
-    this.each(function(value, index) {
-      value = (iterator || Prototype.K)(value, index);
-      if (result == undefined || value < result)
-        result = value;
-    });
-    return result;
-  },
-
-  partition: function(iterator) {
-    var trues = [], falses = [];
-    this.each(function(value, index) {
-      ((iterator || Prototype.K)(value, index) ?
-        trues : falses).push(value);
-    });
-    return [trues, falses];
-  },
-
-  pluck: function(property) {
-    var results = [];
-    this.each(function(value, index) {
-      results.push(value[property]);
-    });
-    return results;
-  },
-
-  reject: function(iterator) {
-    var results = [];
-    this.each(function(value, index) {
-      if (!iterator(value, index))
-        results.push(value);
-    });
-    return results;
-  },
-
-  sortBy: function(iterator) {
-    return this.collect(function(value, index) {
-      return {value: value, criteria: iterator(value, index)};
-    }).sort(function(left, right) {
-      var a = left.criteria, b = right.criteria;
-      return a < b ? -1 : a > b ? 1 : 0;
-    }).pluck('value');
-  },
-
-  toArray: function() {
-    return this.collect(Prototype.K);
-  },
-
-  zip: function() {
-    var iterator = Prototype.K, args = $A(arguments);
-    if (typeof args.last() == 'function')
-      iterator = args.pop();
-
-    var collections = [this].concat(args).map($A);
-    return this.map(function(value, index) {
-      return iterator(collections.pluck(index));
-    });
-  },
-
-  inspect: function() {
-    return '#<Enumerable:' + this.toArray().inspect() + '>';
-  }
-}
-
-Object.extend(Enumerable, {
-  map:     Enumerable.collect,
-  find:    Enumerable.detect,
-  select:  Enumerable.findAll,
-  member:  Enumerable.include,
-  entries: Enumerable.toArray
-});
-var $A = Array.from = function(iterable) {
-  if (!iterable) return [];
-  if (iterable.toArray) {
-    return iterable.toArray();
-  } else {
-    var results = [];
-    for (var i = 0; i < iterable.length; i++)
-      results.push(iterable[i]);
-    return results;
-  }
-}
-
-Object.extend(Array.prototype, Enumerable);
-
-if (!Array.prototype._reverse)
-  Array.prototype._reverse = Array.prototype.reverse;
-
-Object.extend(Array.prototype, {
-  _each: function(iterator) {
-    for (var i = 0; i < this.length; i++)
-      iterator(this[i]);
-  },
-
-  clear: function() {
-    this.length = 0;
-    return this;
-  },
-
-  first: function() {
-    return this[0];
-  },
-
-  last: function() {
-    return this[this.length - 1];
-  },
-
-  compact: function() {
-    return this.select(function(value) {
-      return value != undefined || value != null;
-    });
-  },
-
-  flatten: function() {
-    return this.inject([], function(array, value) {
-      return array.concat(value && value.constructor == Array ?
-        value.flatten() : [value]);
-    });
-  },
-
-  without: function() {
-    var values = $A(arguments);
-    return this.select(function(value) {
-      return !values.include(value);
-    });
-  },
-
-  indexOf: function(object) {
-    for (var i = 0; i < this.length; i++)
-      if (this[i] == object) return i;
-    return -1;
-  },
-
-  reverse: function(inline) {
-    return (inline !== false ? this : this.toArray())._reverse();
-  },
-
-  inspect: function() {
-    return '[' + this.map(Object.inspect).join(', ') + ']';
-  }
-});
-var Hash = {
-  _each: function(iterator) {
-    for (var key in this) {
-      var value = this[key];
-      if (typeof value == 'function') continue;
-
-      var pair = [key, value];
-      pair.key = key;
-      pair.value = value;
-      iterator(pair);
-    }
-  },
-
-  keys: function() {
-    return this.pluck('key');
-  },
-
-  values: function() {
-    return this.pluck('value');
-  },
-
-  merge: function(hash) {
-    return $H(hash).inject($H(this), function(mergedHash, pair) {
-      mergedHash[pair.key] = pair.value;
-      return mergedHash;
-    });
-  },
-
-  toQueryString: function() {
-    return this.map(function(pair) {
-      return pair.map(encodeURIComponent).join('=');
-    }).join('&');
-  },
-
-  inspect: function() {
-    return '#<Hash:{' + this.map(function(pair) {
-      return pair.map(Object.inspect).join(': ');
-    }).join(', ') + '}>';
-  }
-}
-
-function $H(object) {
-  var hash = Object.extend({}, object || {});
-  Object.extend(hash, Enumerable);
-  Object.extend(hash, Hash);
-  return hash;
-}
-ObjectRange = Class.create();
-Object.extend(ObjectRange.prototype, Enumerable);
-Object.extend(ObjectRange.prototype, {
-  initialize: function(start, end, exclusive) {
-    this.start = start;
-    this.end = end;
-    this.exclusive = exclusive;
-  },
-
-  _each: function(iterator) {
-    var value = this.start;
-    do {
-      iterator(value);
-      value = value.succ();
-    } while (this.include(value));
-  },
-
-  include: function(value) {
-    if (value < this.start)
-      return false;
-    if (this.exclusive)
-      return value < this.end;
-    return value <= this.end;
-  }
-});
-
-var $R = function(start, end, exclusive) {
-  return new ObjectRange(start, end, exclusive);
-}
-
-var Ajax = {
-  getTransport: function() {
-    return Try.these(
-      function() {return new XMLHttpRequest()},
-      function() {return new ActiveXObject('Msxml2.XMLHTTP')},
-      function() {return new ActiveXObject('Microsoft.XMLHTTP')}
-    ) || false;
-  },
-
-  activeRequestCount: 0
-}
-
-Ajax.Responders = {
-  responders: [],
-
-  _each: function(iterator) {
-    this.responders._each(iterator);
-  },
-
-  register: function(responderToAdd) {
-    if (!this.include(responderToAdd))
-      this.responders.push(responderToAdd);
-  },
-
-  unregister: function(responderToRemove) {
-    this.responders = this.responders.without(responderToRemove);
-  },
-
-  dispatch: function(callback, request, transport, json) {
-    this.each(function(responder) {
-      if (responder[callback] && typeof responder[callback] == 'function') {
-        try {
-          responder[callback].apply(responder, [request, transport, json]);
-        } catch (e) {}
-      }
-    });
-  }
-};
-
-Object.extend(Ajax.Responders, Enumerable);
-
-Ajax.Responders.register({
-  onCreate: function() {
-    Ajax.activeRequestCount++;
-  },
-
-  onComplete: function() {
-    Ajax.activeRequestCount--;
-  }
-});
-
-Ajax.Base = function() {};
-Ajax.Base.prototype = {
-  setOptions: function(options) {
-    this.options = {
-      method:       'post',
-      asynchronous: true,
-      contentType:  'application/x-www-form-urlencoded',
-      parameters:   ''
-    }
-    Object.extend(this.options, options || {});
-  },
-
-  responseIsSuccess: function() {
-    return this.transport.status == undefined
-        || this.transport.status == 0
-        || (this.transport.status >= 200 && this.transport.status < 300);
-  },
-
-  responseIsFailure: function() {
-    return !this.responseIsSuccess();
-  }
-}
-
-Ajax.Request = Class.create();
-Ajax.Request.Events =
-  ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
-
-Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
-  initialize: function(url, options) {
-    this.transport = Ajax.getTransport();
-    this.setOptions(options);
-    this.request(url);
-  },
-
-  request: function(url) {
-    var parameters = this.options.parameters || '';
-    if (parameters.length > 0) parameters += '&_=';
-
-    try {
-      this.url = url;
-      if (this.options.method == 'get' && parameters.length > 0)
-        this.url += (this.url.match(/\?/) ? '&' : '?') + parameters;
-
-      Ajax.Responders.dispatch('onCreate', this, this.transport);
-
-      this.transport.open(this.options.method, this.url,
-        this.options.asynchronous);
-
-      if (this.options.asynchronous) {
-        this.transport.onreadystatechange = this.onStateChange.bind(this);
-        setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
-      }
-
-      this.setRequestHeaders();
-
-      var body = this.options.postBody ? this.options.postBody : parameters;
-      this.transport.send(this.options.method == 'post' ? body : null);
-
-    } catch (e) {
-      this.dispatchException(e);
-    }
-  },
-
-  setRequestHeaders: function() {
-    var requestHeaders =
-      ['X-Requested-With', 'XMLHttpRequest',
-       'X-Prototype-Version', Prototype.Version,
-       'Accept', 'text/javascript, text/html, application/xml, text/xml, */*'];
-
-    if (this.options.method == 'post') {
-      requestHeaders.push('Content-type', this.options.contentType);
-
-      /* Force "Connection: close" for Mozilla browsers to work around
-       * a bug where XMLHttpReqeuest sends an incorrect Content-length
-       * header. See Mozilla Bugzilla #246651.
-       */
-      if (this.transport.overrideMimeType)
-        requestHeaders.push('Connection', 'close');
-    }
-
-    if (this.options.requestHeaders)
-      requestHeaders.push.apply(requestHeaders, this.options.requestHeaders);
-
-    for (var i = 0; i < requestHeaders.length; i += 2)
-      this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
-  },
-
-  onStateChange: function() {
-    var readyState = this.transport.readyState;
-    if (readyState != 1)
-      this.respondToReadyState(this.transport.readyState);
-  },
-
-  header: function(name) {
-    try {
-      return this.transport.getResponseHeader(name);
-    } catch (e) {}
-  },
-
-  evalJSON: function() {
-    try {
-      return eval('(' + this.header('X-JSON') + ')');
-    } catch (e) {}
-  },
-
-  evalResponse: function() {
-    try {
-      return eval(this.transport.responseText);
-    } catch (e) {
-      this.dispatchException(e);
-    }
-  },
-
-  respondToReadyState: function(readyState) {
-    var event = Ajax.Request.Events[readyState];
-    var transport = this.transport, json = this.evalJSON();
-
-    if (event == 'Complete') {
-      try {
-        (this.options['on' + this.transport.status]
-         || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
-         || Prototype.emptyFunction)(transport, json);
-      } catch (e) {
-        this.dispatchException(e);
-      }
-
-      if ((this.header('Content-type') || '').match(/^text\/javascript/i))
-        this.evalResponse();
-    }
-
-    try {
-      (this.options['on' + event] || Prototype.emptyFunction)(transport, json);
-      Ajax.Responders.dispatch('on' + event, this, transport, json);
-    } catch (e) {
-      this.dispatchException(e);
-    }
-
-    /* Avoid memory leak in MSIE: clean up the oncomplete event handler */
-    if (event == 'Complete')
-      this.transport.onreadystatechange = Prototype.emptyFunction;
-  },
-
-  dispatchException: function(exception) {
-    (this.options.onException || Prototype.emptyFunction)(this, exception);
-    Ajax.Responders.dispatch('onException', this, exception);
-  }
-});
-
-Ajax.Updater = Class.create();
-
-Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
-  initialize: function(container, url, options) {
-    this.containers = {
-      success: container.success ? $PR(container.success) : $PR(container),
-      failure: container.failure ? $PR(container.failure) :
-        (container.success ? null : $PR(container))
-    }
-
-    this.transport = Ajax.getTransport();
-    this.setOptions(options);
-
-    var onComplete = this.options.onComplete || Prototype.emptyFunction;
-    this.options.onComplete = (function(transport, object) {
-      this.updateContent();
-      onComplete(transport, object);
-    }).bind(this);
-
-    this.request(url);
-  },
-
-  updateContent: function() {
-    var receiver = this.responseIsSuccess() ?
-      this.containers.success : this.containers.failure;
-    var response = this.transport.responseText;
-
-    if (!this.options.evalScripts)
-      response = response.stripScripts();
-
-    if (receiver) {
-      if (this.options.insertion) {
-        new this.options.insertion(receiver, response);
-      } else {
-        Element.update(receiver, response);
-      }
-    }
-
-    if (this.responseIsSuccess()) {
-      if (this.onComplete)
-        setTimeout(this.onComplete.bind(this), 10);
-    }
-  }
-});
-
-Ajax.PeriodicalUpdater = Class.create();
-Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
-  initialize: function(container, url, options) {
-    this.setOptions(options);
-    this.onComplete = this.options.onComplete;
-
-    this.frequency = (this.options.frequency || 2);
-    this.decay = (this.options.decay || 1);
-
-    this.updater = {};
-    this.container = container;
-    this.url = url;
-
-    this.start();
-  },
-
-  start: function() {
-    this.options.onComplete = this.updateComplete.bind(this);
-    this.onTimerEvent();
-  },
-
-  stop: function() {
-    this.updater.onComplete = undefined;
-    clearTimeout(this.timer);
-    (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
-  },
-
-  updateComplete: function(request) {
-    if (this.options.decay) {
-      this.decay = (request.responseText == this.lastText ?
-        this.decay * this.options.decay : 1);
-
-      this.lastText = request.responseText;
-    }
-    this.timer = setTimeout(this.onTimerEvent.bind(this),
-      this.decay * this.frequency * 1000);
-  },
-
-  onTimerEvent: function() {
-    this.updater = new Ajax.Updater(this.container, this.url, this.options);
-  }
-});
-function $PR() {
-  var results = [], element;
-  for (var i = 0; i < arguments.length; i++) {
-    element = arguments[i];
-    if (typeof element == 'string')
-      element = document.getElementById(element);
-    results.push(Element.extend(element));
-  }
-  return results.length < 2 ? results[0] : results;
-}
-
-document.getElementsByClassName = function(className, parentElement) {
-  var children = ($PR(parentElement) || document.body).getElementsByTagName('*');
-  return $A(children).inject([], function(elements, child) {
-    if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
-      elements.push(Element.extend(child));
-    return elements;
-  });
-}
-
-/*--------------------------------------------------------------------------*/
-
-if (!window.Element)
-  var Element = new Object();
-
-Element.extend = function(element) {
-  if (!element) return;
-  if (_nativeExtensions) return element;
-
-  if (!element._extended && element.tagName && element != window) {
-    var methods = Element.Methods, cache = Element.extend.cache;
-    for (property in methods) {
-      var value = methods[property];
-      if (typeof value == 'function')
-        element[property] = cache.findOrStore(value);
-    }
-  }
-
-  element._extended = true;
-  return element;
-}
-
-Element.extend.cache = {
-  findOrStore: function(value) {
-    return this[value] = this[value] || function() {
-      return value.apply(null, [this].concat($A(arguments)));
-    }
-  }
-}
-
-Element.Methods = {
-  visible: function(element) {
-    return $PR(element).style.display != 'none';
-  },
-
-  toggle: function() {
-    for (var i = 0; i < arguments.length; i++) {
-      var element = $PR(arguments[i]);
-      Element[Element.visible(element) ? 'hide' : 'show'](element);
-    }
-  },
-
-  hide: function() {
-    for (var i = 0; i < arguments.length; i++) {
-      var element = $PR(arguments[i]);
-      element.style.display = 'none';
-    }
-  },
-
-  show: function() {
-    for (var i = 0; i < arguments.length; i++) {
-      var element = $PR(arguments[i]);
-      element.style.display = '';
-    }
-  },
-
-  remove: function(element) {
-    element = $PR(element);
-    element.parentNode.removeChild(element);
-  },
-
-  update: function(element, html) {
-    $PR(element).innerHTML = html.stripScripts();
-    setTimeout(function() {html.evalScripts()}, 10);
-  },
-
-  replace: function(element, html) {
-    element = $PR(element);
-    if (element.outerHTML) {
-      element.outerHTML = html.stripScripts();
-    } else {
-      var range = element.ownerDocument.createRange();
-      range.selectNodeContents(element);
-      element.parentNode.replaceChild(
-        range.createContextualFragment(html.stripScripts()), element);
-    }
-    setTimeout(function() {html.evalScripts()}, 10);
-  },
-
-  getHeight: function(element) {
-    element = $PR(element);
-    return element.offsetHeight;
-  },
-
-  classNames: function(element) {
-    return new Element.ClassNames(element);
-  },
-
-  hasClassName: function(element, className) {
-    if (!(element = $PR(element))) return;
-    return Element.classNames(element).include(className);
-  },
-
-  addClassName: function(element, className) {
-    if (!(element = $PR(element))) return;
-    return Element.classNames(element).add(className);
-  },
-
-  removeClassName: function(element, className) {
-    if (!(element = $PR(element))) return;
-    return Element.classNames(element).remove(className);
-  },
-
-  // removes whitespace-only text node children
-  cleanWhitespace: function(element) {
-    element = $PR(element);
-    for (var i = 0; i < element.childNodes.length; i++) {
-      var node = element.childNodes[i];
-      if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
-        Element.remove(node);
-    }
-  },
-
-  empty: function(element) {
-    return $PR(element).innerHTML.match(/^\s*$/);
-  },
-
-  childOf: function(element, ancestor) {
-    element = $PR(element), ancestor = $PR(ancestor);
-    while (element = element.parentNode)
-      if (element == ancestor) return true;
-    return false;
-  },
-
-  scrollTo: function(element) {
-    element = $PR(element);
-    var x = element.x ? element.x : element.offsetLeft,
-        y = element.y ? element.y : element.offsetTop;
-    window.scrollTo(x, y);
-  },
-
-  getStyle: function(element, style) {
-    element = $PR(element);
-    var value = element.style[style.camelize()];
-    if (!value) {
-      if (document.defaultView && document.defaultView.getComputedStyle) {
-        var css = document.defaultView.getComputedStyle(element, null);
-        value = css ? css.getPropertyValue(style) : null;
-      } else if (element.currentStyle) {
-        value = element.currentStyle[style.camelize()];
-      }
-    }
-
-    if (window.opera && ['left', 'top', 'right', 'bottom'].include(style))
-      if (Element.getStyle(element, 'position') == 'static') value = 'auto';
-
-    return value == 'auto' ? null : value;
-  },
-
-  setStyle: function(element, style) {
-    element = $PR(element);
-    for (var name in style)
-      element.style[name.camelize()] = style[name];
-  },
-
-  getDimensions: function(element) {
-    element = $PR(element);
-    if (Element.getStyle(element, 'display') != 'none')
-      return {width: element.offsetWidth, height: element.offsetHeight};
-
-    // All *Width and *Height properties give 0 on elements with display none,
-    // so enable the element temporarily
-    var els = element.style;
-    var originalVisibility = els.visibility;
-    var originalPosition = els.position;
-    els.visibility = 'hidden';
-    els.position = 'absolute';
-    els.display = '';
-    var originalWidth = element.clientWidth;
-    var originalHeight = element.clientHeight;
-    els.display = 'none';
-    els.position = originalPosition;
-    els.visibility = originalVisibility;
-    return {width: originalWidth, height: originalHeight};
-  },
-
-  makePositioned: function(element) {
-    element = $PR(element);
-    var pos = Element.getStyle(element, 'position');
-    if (pos == 'static' || !pos) {
-      element._madePositioned = true;
-      element.style.position = 'relative';
-      // Opera returns the offset relative to the positioning context, when an
-      // element is position relative but top and left have not been defined
-      if (window.opera) {
-        element.style.top = 0;
-        element.style.left = 0;
-      }
-    }
-  },
-
-  undoPositioned: function(element) {
-    element = $PR(element);
-    if (element._madePositioned) {
-      element._madePositioned = undefined;
-      element.style.position =
-        element.style.top =
-        element.style.left =
-        element.style.bottom =
-        element.style.right = '';
-    }
-  },
-
-  makeClipping: function(element) {
-    element = $PR(element);
-    if (element._overflow) return;
-    element._overflow = element.style.overflow;
-    if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden')
-      element.style.overflow = 'hidden';
-  },
-
-  undoClipping: function(element) {
-    element = $PR(element);
-    if (element._overflow) return;
-    element.style.overflow = element._overflow;
-    element._overflow = undefined;
-  }
-}
-
-Object.extend(Element, Element.Methods);
-
-var _nativeExtensions = false;
-
-if(!HTMLElement && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
-  var HTMLElement = {}
-  HTMLElement.prototype = document.createElement('div').__proto__;
-}
-
-Element.addMethods = function(methods) {
-  Object.extend(Element.Methods, methods || {});
-
-  if(typeof HTMLElement != 'undefined') {
-    var methods = Element.Methods, cache = Element.extend.cache;
-    for (property in methods) {
-      var value = methods[property];
-      if (typeof value == 'function')
-        HTMLElement.prototype[property] = cache.findOrStore(value);
-    }
-    _nativeExtensions = true;
-  }
-}
-
-Element.addMethods();
-
-var Toggle = new Object();
-Toggle.display = Element.toggle;
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.Insertion = function(adjacency) {
-  this.adjacency = adjacency;
-}
-
-Abstract.Insertion.prototype = {
-  initialize: function(element, content) {
-    this.element = $PR(element);
-    this.content = content.stripScripts();
-
-    if (this.adjacency && this.element.insertAdjacentHTML) {
-      try {
-        this.element.insertAdjacentHTML(this.adjacency, this.content);
-      } catch (e) {
-        var tagName = this.element.tagName.toLowerCase();
-        if (tagName == 'tbody' || tagName == 'tr') {
-          this.insertContent(this.contentFromAnonymousTable());
-        } else {
-          throw e;
-        }
-      }
-    } else {
-      this.range = this.element.ownerDocument.createRange();
-      if (this.initializeRange) this.initializeRange();
-      this.insertContent([this.range.createContextualFragment(this.content)]);
-    }
-
-    setTimeout(function() {content.evalScripts()}, 10);
-  },
-
-  contentFromAnonymousTable: function() {
-    var div = document.createElement('div');
-    div.innerHTML = '<table><tbody>' + this.content + '</tbody></table>';
-    return $A(div.childNodes[0].childNodes[0].childNodes);
-  }
-}
-
-var Insertion = new Object();
-
-Insertion.Before = Class.create();
-Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
-  initializeRange: function() {
-    this.range.setStartBefore(this.element);
-  },
-
-  insertContent: function(fragments) {
-    fragments.each((function(fragment) {
-      this.element.parentNode.insertBefore(fragment, this.element);
-    }).bind(this));
-  }
-});
-
-Insertion.Top = Class.create();
-Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
-  initializeRange: function() {
-    this.range.selectNodeContents(this.element);
-    this.range.collapse(true);
-  },
-
-  insertContent: function(fragments) {
-    fragments.reverse(false).each((function(fragment) {
-      this.element.insertBefore(fragment, this.element.firstChild);
-    }).bind(this));
-  }
-});
-
-Insertion.Bottom = Class.create();
-Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
-  initializeRange: function() {
-    this.range.selectNodeContents(this.element);
-    this.range.collapse(this.element);
-  },
-
-  insertContent: function(fragments) {
-    fragments.each((function(fragment) {
-      this.element.appendChild(fragment);
-    }).bind(this));
-  }
-});
-
-Insertion.After = Class.create();
-Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
-  initializeRange: function() {
-    this.range.setStartAfter(this.element);
-  },
-
-  insertContent: function(fragments) {
-    fragments.each((function(fragment) {
-      this.element.parentNode.insertBefore(fragment,
-        this.element.nextSibling);
-    }).bind(this));
-  }
-});
-
-/*--------------------------------------------------------------------------*/
-
-Element.ClassNames = Class.create();
-Element.ClassNames.prototype = {
-  initialize: function(element) {
-    this.element = $PR(element);
-  },
-
-  _each: function(iterator) {
-    this.element.className.split(/\s+/).select(function(name) {
-      return name.length > 0;
-    })._each(iterator);
-  },
-
-  set: function(className) {
-    this.element.className = className;
-  },
-
-  add: function(classNameToAdd) {
-    if (this.include(classNameToAdd)) return;
-    this.set(this.toArray().concat(classNameToAdd).join(' '));
-  },
-
-  remove: function(classNameToRemove) {
-    if (!this.include(classNameToRemove)) return;
-    this.set(this.select(function(className) {
-      return className != classNameToRemove;
-    }).join(' '));
-  },
-
-  toString: function() {
-    return this.toArray().join(' ');
-  }
-}
-
-Object.extend(Element.ClassNames.prototype, Enumerable);
-var Selector = Class.create();
-Selector.prototype = {
-  initialize: function(expression) {
-    this.params = {classNames: []};
-    this.expression = expression.toString().strip();
-    this.parseExpression();
-    this.compileMatcher();
-  },
-
-  parseExpression: function() {
-    function abort(message) { throw 'Parse error in selector: ' + message; }
-
-    if (this.expression == '')  abort('empty expression');
-
-    var params = this.params, expr = this.expression, match, modifier, clause, rest;
-    while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) {
-      params.attributes = params.attributes || [];
-      params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''});
-      expr = match[1];
-    }
-
-    if (expr == '*') return this.params.wildcard = true;
-
-    while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) {
-      modifier = match[1], clause = match[2], rest = match[3];
-      switch (modifier) {
-        case '#':       params.id = clause; break;
-        case '.':       params.classNames.push(clause); break;
-        case '':
-        case undefined: params.tagName = clause.toUpperCase(); break;
-        default:        abort(expr.inspect());
-      }
-      expr = rest;
-    }
-
-    if (expr.length > 0) abort(expr.inspect());
-  },
-
-  buildMatchExpression: function() {
-    var params = this.params, conditions = [], clause;
-
-    if (params.wildcard)
-      conditions.push('true');
-    if (clause = params.id)
-      conditions.push('element.id == ' + clause.inspect());
-    if (clause = params.tagName)
-      conditions.push('element.tagName.toUpperCase() == ' + clause.inspect());
-    if ((clause = params.classNames).length > 0)
-      for (var i = 0; i < clause.length; i++)
-        conditions.push('Element.hasClassName(element, ' + clause[i].inspect() + ')');
-    if (clause = params.attributes) {
-      clause.each(function(attribute) {
-        var value = 'element.getAttribute(' + attribute.name.inspect() + ')';
-        var splitValueBy = function(delimiter) {
-          return value + ' && ' + value + '.split(' + delimiter.inspect() + ')';
-        }
-
-        switch (attribute.operator) {
-          case '=':       conditions.push(value + ' == ' + attribute.value.inspect()); break;
-          case '~=':      conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + ')'); break;
-          case '|=':      conditions.push(
-                            splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect()
-                          ); break;
-          case '!=':      conditions.push(value + ' != ' + attribute.value.inspect()); break;
-          case '':
-          case undefined: conditions.push(value + ' != null'); break;
-          default:        throw 'Unknown operator ' + attribute.operator + ' in selector';
-        }
-      });
-    }
-
-    return conditions.join(' && ');
-  },
-
-  compileMatcher: function() {
-    this.match = new Function('element', 'if (!element.tagName) return false; \
-      return ' + this.buildMatchExpression());
-  },
-
-  findElements: function(scope) {
-    var element;
-
-    if (element = $PR(this.params.id))
-      if (this.match(element))
-        if (!scope || Element.childOf(element, scope))
-          return [element];
-
-    scope = (scope || document).getElementsByTagName(this.params.tagName || '*');
-
-    var results = [];
-    for (var i = 0; i < scope.length; i++)
-      if (this.match(element = scope[i]))
-        results.push(Element.extend(element));
-
-    return results;
-  },
-
-  toString: function() {
-    return this.expression;
-  }
-}
-
-function $$() {
-  return $A(arguments).map(function(expression) {
-    return expression.strip().split(/\s+/).inject([null], function(results, expr) {
-      var selector = new Selector(expr);
-      return results.map(selector.findElements.bind(selector)).flatten();
-    });
-  }).flatten();
-}
-var Field = {
-  clear: function() {
-    for (var i = 0; i < arguments.length; i++)
-      $PR(arguments[i]).value = '';
-  },
-
-  focus: function(element) {
-    $PR(element).focus();
-  },
-
-  present: function() {
-    for (var i = 0; i < arguments.length; i++)
-      if ($PR(arguments[i]).value == '') return false;
-    return true;
-  },
-
-  select: function(element) {
-    $PR(element).select();
-  },
-
-  activate: function(element) {
-    element = $PR(element);
-    element.focus();
-    if (element.select)
-      element.select();
-  }
-}
-
-/*--------------------------------------------------------------------------*/
-
-var Form = {
-  serialize: function(form) {
-    var elements = Form.getElements($PR(form));
-    var queryComponents = new Array();
-
-    for (var i = 0; i < elements.length; i++) {
-      var queryComponent = Form.Element.serialize(elements[i]);
-      if (queryComponent)
-        queryComponents.push(queryComponent);
-    }
-
-    return queryComponents.join('&');
-  },
-
-  getElements: function(form) {
-    form = $PR(form);
-    var elements = new Array();
-
-    for (var tagName in Form.Element.Serializers) {
-      var tagElements = form.getElementsByTagName(tagName);
-      for (var j = 0; j < tagElements.length; j++)
-        elements.push(tagElements[j]);
-    }
-    return elements;
-  },
-
-  getInputs: function(form, typeName, name) {
-    form = $PR(form);
-    var inputs = form.getElementsByTagName('input');
-
-    if (!typeName && !name)
-      return inputs;
-
-    var matchingInputs = new Array();
-    for (var i = 0; i < inputs.length; i++) {
-      var input = inputs[i];
-      if ((typeName && input.type != typeName) ||
-          (name && input.name != name))
-        continue;
-      matchingInputs.push(input);
-    }
-
-    return matchingInputs;
-  },
-
-  disable: function(form) {
-    var elements = Form.getElements(form);
-    for (var i = 0; i < elements.length; i++) {
-      var element = elements[i];
-      element.blur();
-      element.disabled = 'true';
-    }
-  },
-
-  enable: function(form) {
-    var elements = Form.getElements(form);
-    for (var i = 0; i < elements.length; i++) {
-      var element = elements[i];
-      element.disabled = '';
-    }
-  },
-
-  findFirstElement: function(form) {
-    return Form.getElements(form).find(function(element) {
-      return element.type != 'hidden' && !element.disabled &&
-        ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
-    });
-  },
-
-  focusFirstElement: function(form) {
-    Field.activate(Form.findFirstElement(form));
-  },
-
-  reset: function(form) {
-    $PR(form).reset();
-  }
-}
-
-Form.Element = {
-  serialize: function(element) {
-    element = $PR(element);
-    var method = element.tagName.toLowerCase();
-    var parameter = Form.Element.Serializers[method](element);
-
-    if (parameter) {
-      var key = encodeURIComponent(parameter[0]);
-      if (key.length == 0) return;
-
-      if (parameter[1].constructor != Array)
-        parameter[1] = [parameter[1]];
-
-      return parameter[1].map(function(value) {
-        return key + '=' + encodeURIComponent(value);
-      }).join('&');
-    }
-  },
-
-  getValue: function(element) {
-    element = $PR(element);
-    var method = element.tagName.toLowerCase();
-    var parameter = Form.Element.Serializers[method](element);
-
-    if (parameter)
-      return parameter[1];
-  }
-}
-
-Form.Element.Serializers = {
-  input: function(element) {
-    switch (element.type.toLowerCase()) {
-      case 'submit':
-      case 'hidden':
-      case 'password':
-      case 'text':
-        return Form.Element.Serializers.textarea(element);
-      case 'checkbox':
-      case 'radio':
-        return Form.Element.Serializers.inputSelector(element);
-    }
-    return false;
-  },
-
-  inputSelector: function(element) {
-    if (element.checked)
-      return [element.name, element.value];
-  },
-
-  textarea: function(element) {
-    return [element.name, element.value];
-  },
-
-  select: function(element) {
-    return Form.Element.Serializers[element.type == 'select-one' ?
-      'selectOne' : 'selectMany'](element);
-  },
-
-  selectOne: function(element) {
-    var value = '', opt, index = element.selectedIndex;
-    if (index >= 0) {
-      opt = element.options[index];
-      value = opt.value || opt.text;
-    }
-    return [element.name, value];
-  },
-
-  selectMany: function(element) {
-    var value = [];
-    for (var i = 0; i < element.length; i++) {
-      var opt = element.options[i];
-      if (opt.selected)
-        value.push(opt.value || opt.text);
-    }
-    return [element.name, value];
-  }
-}
-
-/*--------------------------------------------------------------------------*/
-
-var $F = Form.Element.getValue;
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.TimedObserver = function() {}
-Abstract.TimedObserver.prototype = {
-  initialize: function(element, frequency, callback) {
-    this.frequency = frequency;
-    this.element   = $PR(element);
-    this.callback  = callback;
-
-    this.lastValue = this.getValue();
-    this.registerCallback();
-  },
-
-  registerCallback: function() {
-    setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
-  },
-
-  onTimerEvent: function() {
-    var value = this.getValue();
-    if (this.lastValue != value) {
-      this.callback(this.element, value);
-      this.lastValue = value;
-    }
-  }
-}
-
-Form.Element.Observer = Class.create();
-Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
-  getValue: function() {
-    return Form.Element.getValue(this.element);
-  }
-});
-
-Form.Observer = Class.create();
-Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
-  getValue: function() {
-    return Form.serialize(this.element);
-  }
-});
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.EventObserver = function() {}
-Abstract.EventObserver.prototype = {
-  initialize: function(element, callback) {
-    this.element  = $PR(element);
-    this.callback = callback;
-
-    this.lastValue = this.getValue();
-    if (this.element.tagName.toLowerCase() == 'form')
-      this.registerFormCallbacks();
-    else
-      this.registerCallback(this.element);
-  },
-
-  onElementEvent: function() {
-    var value = this.getValue();
-    if (this.lastValue != value) {
-      this.callback(this.element, value);
-      this.lastValue = value;
-    }
-  },
-
-  registerFormCallbacks: function() {
-    var elements = Form.getElements(this.element);
-    for (var i = 0; i < elements.length; i++)
-      this.registerCallback(elements[i]);
-  },
-
-  registerCallback: function(element) {
-    if (element.type) {
-      switch (element.type.toLowerCase()) {
-        case 'checkbox':
-        case 'radio':
-          Event.observe(element, 'click', this.onElementEvent.bind(this));
-          break;
-        case 'password':
-        case 'text':
-        case 'textarea':
-        case 'select-one':
-        case 'select-multiple':
-          Event.observe(element, 'change', this.onElementEvent.bind(this));
-          break;
-      }
-    }
-  }
-}
-
-Form.Element.EventObserver = Class.create();
-Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
-  getValue: function() {
-    return Form.Element.getValue(this.element);
-  }
-});
-
-Form.EventObserver = Class.create();
-Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
-  getValue: function() {
-    return Form.serialize(this.element);
-  }
-});
-if (!window.Event) {
-  var Event = new Object();
-}
-
-Object.extend(Event, {
-  KEY_BACKSPACE: 8,
-  KEY_TAB:       9,
-  KEY_RETURN:   13,
-  KEY_ESC:      27,
-  KEY_LEFT:     37,
-  KEY_UP:       38,
-  KEY_RIGHT:    39,
-  KEY_DOWN:     40,
-  KEY_DELETE:   46,
-
-  element: function(event) {
-    return event.target || event.srcElement;
-  },
-
-  isLeftClick: function(event) {
-    return (((event.which) && (event.which == 1)) ||
-            ((event.button) && (event.button == 1)));
-  },
-
-  pointerX: function(event) {
-    return event.pageX || (event.clientX +
-      (document.documentElement.scrollLeft || document.body.scrollLeft));
-  },
-
-  pointerY: function(event) {
-    return event.pageY || (event.clientY +
-      (document.documentElement.scrollTop || document.body.scrollTop));
-  },
-
-  stop: function(event) {
-    if (event.preventDefault) {
-      event.preventDefault();
-      event.stopPropagation();
-    } else {
-      event.returnValue = false;
-      event.cancelBubble = true;
-    }
-  },
-
-  // find the first node with the given tagName, starting from the
-  // node the event was triggered on; traverses the DOM upwards
-  findElement: function(event, tagName) {
-    var element = Event.element(event);
-    while (element.parentNode && (!element.tagName ||
-        (element.tagName.toUpperCase() != tagName.toUpperCase())))
-      element = element.parentNode;
-    return element;
-  },
-
-  observers: false,
-
-  _observeAndCache: function(element, name, observer, useCapture) {
-    if (!this.observers) this.observers = [];
-    if (element.addEventListener) {
-      this.observers.push([element, name, observer, useCapture]);
-      element.addEventListener(name, observer, useCapture);
-    } else if (element.attachEvent) {
-      this.observers.push([element, name, observer, useCapture]);
-      element.attachEvent('on' + name, observer);
-    }
-  },
-
-  unloadCache: function() {
-    if (!Event.observers) return;
-    for (var i = 0; i < Event.observers.length; i++) {
-      Event.stopObserving.apply(this, Event.observers[i]);
-      Event.observers[i][0] = null;
-    }
-    Event.observers = false;
-  },
-
-  observe: function(element, name, observer, useCapture) {
-    var element = $PR(element);
-    useCapture = useCapture || false;
-
-    if (name == 'keypress' &&
-        (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
-        || element.attachEvent))
-      name = 'keydown';
-
-    this._observeAndCache(element, name, observer, useCapture);
-  },
-
-  stopObserving: function(element, name, observer, useCapture) {
-    var element = $PR(element);
-    useCapture = useCapture || false;
-
-    if (name == 'keypress' &&
-        (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
-        || element.detachEvent))
-      name = 'keydown';
-
-    if (element.removeEventListener) {
-      element.removeEventListener(name, observer, useCapture);
-    } else if (element.detachEvent) {
-      element.detachEvent('on' + name, observer);
-    }
-  }
-});
-
-/* prevent memory leaks in IE */
-if (navigator.appVersion.match(/\bMSIE\b/))
-  Event.observe(window, 'unload', Event.unloadCache, false);
-var Position = {
-  // set to true if needed, warning: firefox performance problems
-  // NOT neeeded for page scrolling, only if draggable contained in
-  // scrollable elements
-  includeScrollOffsets: false,
-
-  // must be called before calling withinIncludingScrolloffset, every time the
-  // page is scrolled
-  prepare: function() {
-    this.deltaX =  window.pageXOffset
-                || document.documentElement.scrollLeft
-                || document.body.scrollLeft
-                || 0;
-    this.deltaY =  window.pageYOffset
-                || document.documentElement.scrollTop
-                || document.body.scrollTop
-                || 0;
-  },
-
-  realOffset: function(element) {
-    var valueT = 0, valueL = 0;
-    do {
-      valueT += element.scrollTop  || 0;
-      valueL += element.scrollLeft || 0;
-      element = element.parentNode;
-    } while (element);
-    return [valueL, valueT];
-  },
-
-  cumulativeOffset: function(element) {
-    var valueT = 0, valueL = 0;
-    do {
-      valueT += element.offsetTop  || 0;
-      valueL += element.offsetLeft || 0;
-      element = element.offsetParent;
-    } while (element);
-    return [valueL, valueT];
-  },
-
-  positionedOffset: function(element) {
-    var valueT = 0, valueL = 0;
-    do {
-      valueT += element.offsetTop  || 0;
-      valueL += element.offsetLeft || 0;
-      element = element.offsetParent;
-      if (element) {
-        p = Element.getStyle(element, 'position');
-        if (p == 'relative' || p == 'absolute') break;
-      }
-    } while (element);
-    return [valueL, valueT];
-  },
-
-  offsetParent: function(element) {
-    if (element.offsetParent) return element.offsetParent;
-    if (element == document.body) return element;
-
-    while ((element = element.parentNode) && element != document.body)
-      if (Element.getStyle(element, 'position') != 'static')
-        return element;
-
-    return document.body;
-  },
-
-  // caches x/y coordinate pair to use with overlap
-  within: function(element, x, y) {
-    if (this.includeScrollOffsets)
-      return this.withinIncludingScrolloffsets(element, x, y);
-    this.xcomp = x;
-    this.ycomp = y;
-    this.offset = this.cumulativeOffset(element);
-
-    return (y >= this.offset[1] &&
-            y <  this.offset[1] + element.offsetHeight &&
-            x >= this.offset[0] &&
-            x <  this.offset[0] + element.offsetWidth);
-  },
-
-  withinIncludingScrolloffsets: function(element, x, y) {
-    var offsetcache = this.realOffset(element);
-
-    this.xcomp = x + offsetcache[0] - this.deltaX;
-    this.ycomp = y + offsetcache[1] - this.deltaY;
-    this.offset = this.cumulativeOffset(element);
-
-    return (this.ycomp >= this.offset[1] &&
-            this.ycomp <  this.offset[1] + element.offsetHeight &&
-            this.xcomp >= this.offset[0] &&
-            this.xcomp <  this.offset[0] + element.offsetWidth);
-  },
-
-  // within must be called directly before
-  overlap: function(mode, element) {
-    if (!mode) return 0;
-    if (mode == 'vertical')
-      return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
-        element.offsetHeight;
-    if (mode == 'horizontal')
-      return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
-        element.offsetWidth;
-  },
-
-  clone: function(source, target) {
-    source = $PR(source);
-    target = $PR(target);
-    target.style.position = 'absolute';
-    var offsets = this.cumulativeOffset(source);
-    target.style.top    = offsets[1] + 'px';
-    target.style.left   = offsets[0] + 'px';
-    target.style.width  = source.offsetWidth + 'px';
-    target.style.height = source.offsetHeight + 'px';
-  },
-
-  page: function(forElement) {
-    var valueT = 0, valueL = 0;
-
-    var element = forElement;
-    do {
-      valueT += element.offsetTop  || 0;
-      valueL += element.offsetLeft || 0;
-
-      // Safari fix
-      if (element.offsetParent==document.body)
-        if (Element.getStyle(element,'position')=='absolute') break;
-
-    } while (element = element.offsetParent);
-
-    element = forElement;
-    do {
-      valueT -= element.scrollTop  || 0;
-      valueL -= element.scrollLeft || 0;
-    } while (element = element.parentNode);
-
-    return [valueL, valueT];
-  },
-
-  clone: function(source, target) {
-    var options = Object.extend({
-      setLeft:    true,
-      setTop:     true,
-      setWidth:   true,
-      setHeight:  true,
-      offsetTop:  0,
-      offsetLeft: 0
-    }, arguments[2] || {})
-
-    // find page position of source
-    source = $PR(source);
-    var p = Position.page(source);
-
-    // find coordinate system to use
-    target = $PR(target);
-    var delta = [0, 0];
-    var parent = null;
-    // delta [0,0] will do fine with position: fixed elements,
-    // position:absolute needs offsetParent deltas
-    if (Element.getStyle(target,'position') == 'absolute') {
-      parent = Position.offsetParent(target);
-      delta = Position.page(parent);
-    }
-
-    // correct by body offsets (fixes Safari)
-    if (parent == document.body) {
-      delta[0] -= document.body.offsetLeft;
-      delta[1] -= document.body.offsetTop;
-    }
-
-    // set position
-    if(options.setLeft)   target.style.left  = (p[0] - delta[0] + options.offsetLeft) + 'px';
-    if(options.setTop)    target.style.top   = (p[1] - delta[1] + options.offsetTop) + 'px';
-    if(options.setWidth)  target.style.width = source.offsetWidth + 'px';
-    if(options.setHeight) target.style.height = source.offsetHeight + 'px';
-  },
-
-  absolutize: function(element) {
-    element = $PR(element);
-    if (element.style.position == 'absolute') return;
-    Position.prepare();
-
-    var offsets = Position.positionedOffset(element);
-    var top     = offsets[1];
-    var left    = offsets[0];
-    var width   = element.clientWidth;
-    var height  = element.clientHeight;
-
-    element._originalLeft   = left - parseFloat(element.style.left  || 0);
-    element._originalTop    = top  - parseFloat(element.style.top || 0);
-    element._originalWidth  = element.style.width;
-    element._originalHeight = element.style.height;
-
-    element.style.position = 'absolute';
-    element.style.top    = top + 'px';;
-    element.style.left   = left + 'px';;
-    element.style.width  = width + 'px';;
-    element.style.height = height + 'px';;
-  },
-
-  relativize: function(element) {
-    element = $PR(element);
-    if (element.style.position == 'relative') return;
-    Position.prepare();
-
-    element.style.position = 'relative';
-    var top  = parseFloat(element.style.top  || 0) - (element._originalTop || 0);
-    var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
-
-    element.style.top    = top + 'px';
-    element.style.left   = left + 'px';
-    element.style.height = element._originalHeight;
-    element.style.width  = element._originalWidth;
-  }
-}
-
-// Safari returns margins on body which is incorrect if the child is absolutely
-// positioned.  For performance reasons, redefine Position.cumulativeOffset for
-// KHTML/WebKit only.
-if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
-  Position.cumulativeOffset = function(element) {
-    var valueT = 0, valueL = 0;
-    do {
-      valueT += element.offsetTop  || 0;
-      valueL += element.offsetLeft || 0;
-      if (element.offsetParent == document.body)
-        if (Element.getStyle(element, 'position') == 'absolute') break;
-
-      element = element.offsetParent;
-    } while (element);
-
-    return [valueL, valueT];
-  }
-}
diff --git a/view/js/cropper/lib/scriptaculous.js b/view/js/cropper/lib/scriptaculous.js
deleted file mode 100644 (file)
index f61fc57..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-// 
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-var Scriptaculous = {
-  Version: '1.6.1',
-  require: function(libraryName) {
-    // inserting via DOM fails in Safari 2.0, so brute force approach
-    document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
-  },
-  load: function() {
-    if((typeof Prototype=='undefined') || 
-       (typeof Element == 'undefined') || 
-       (typeof Element.Methods=='undefined') ||
-       parseFloat(Prototype.Version.split(".")[0] + "." +
-                  Prototype.Version.split(".")[1]) < 1.5)
-       throw("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0");
-    
-    $A(document.getElementsByTagName("script")).findAll( function(s) {
-      return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
-    }).each( function(s) {
-      var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
-      var includes = s.src.match(/\?.*load=([a-z,]*)/);
-      (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider').split(',').each(
-       function(include) { Scriptaculous.require(path+include+'.js') });
-    });
-  }
-}
-
-Scriptaculous.load();
\ No newline at end of file
diff --git a/view/js/cropper/lib/slider.js b/view/js/cropper/lib/slider.js
deleted file mode 100644 (file)
index cd16b69..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-// Copyright (c) 2005 Marty Haught, Thomas Fuchs 
-//
-// See http://script.aculo.us for more info
-// 
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-if(!Control) var Control = {};
-Control.Slider = Class.create();
-
-// options:
-//  axis: 'vertical', or 'horizontal' (default)
-//
-// callbacks:
-//  onChange(value)
-//  onSlide(value)
-Control.Slider.prototype = {
-  initialize: function(handle, track, options) {
-    var slider = this;
-    
-    if(handle instanceof Array) {
-      this.handles = handle.collect( function(e) { return $PR(e) });
-    } else {
-      this.handles = [$PR(handle)];
-    }
-    
-    this.track   = $PR(track);
-    this.options = options || {};
-
-    this.axis      = this.options.axis || 'horizontal';
-    this.increment = this.options.increment || 1;
-    this.step      = parseInt(this.options.step || '1');
-    this.range     = this.options.range || $R(0,1);
-    
-    this.value     = 0; // assure backwards compat
-    this.values    = this.handles.map( function() { return 0 });
-    this.spans     = this.options.spans ? this.options.spans.map(function(s){ return $PR(s) }) : false;
-    this.options.startSpan = $PR(this.options.startSpan || null);
-    this.options.endSpan   = $PR(this.options.endSpan || null);
-
-    this.restricted = this.options.restricted || false;
-
-    this.maximum   = this.options.maximum || this.range.end;
-    this.minimum   = this.options.minimum || this.range.start;
-
-    // Will be used to align the handle onto the track, if necessary
-    this.alignX = parseInt(this.options.alignX || '0');
-    this.alignY = parseInt(this.options.alignY || '0');
-    
-    this.trackLength = this.maximumOffset() - this.minimumOffset();
-    this.handleLength = this.isVertical() ? this.handles[0].offsetHeight : this.handles[0].offsetWidth;
-
-    this.active   = false;
-    this.dragging = false;
-    this.disabled = false;
-
-    if(this.options.disabled) this.setDisabled();
-
-    // Allowed values array
-    this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false;
-    if(this.allowedValues) {
-      this.minimum = this.allowedValues.min();
-      this.maximum = this.allowedValues.max();
-    }
-
-    this.eventMouseDown = this.startDrag.bindAsEventListener(this);
-    this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
-    this.eventMouseMove = this.update.bindAsEventListener(this);
-
-    // Initialize handles in reverse (make sure first handle is active)
-    this.handles.each( function(h,i) {
-      i = slider.handles.length-1-i;
-      slider.setValue(parseFloat(
-        (slider.options.sliderValue instanceof Array ? 
-          slider.options.sliderValue[i] : slider.options.sliderValue) || 
-         slider.range.start), i);
-      Element.makePositioned(h); // fix IE
-      Event.observe(h, "mousedown", slider.eventMouseDown);
-    });
-    
-    Event.observe(this.track, "mousedown", this.eventMouseDown);
-    Event.observe(document, "mouseup", this.eventMouseUp);
-    Event.observe(document, "mousemove", this.eventMouseMove);
-    
-    this.initialized = true;
-  },
-  dispose: function() {
-    var slider = this;    
-    Event.stopObserving(this.track, "mousedown", this.eventMouseDown);
-    Event.stopObserving(document, "mouseup", this.eventMouseUp);
-    Event.stopObserving(document, "mousemove", this.eventMouseMove);
-    this.handles.each( function(h) {
-      Event.stopObserving(h, "mousedown", slider.eventMouseDown);
-    });
-  },
-  setDisabled: function(){
-    this.disabled = true;
-  },
-  setEnabled: function(){
-    this.disabled = false;
-  },  
-  getNearestValue: function(value){
-    if(this.allowedValues){
-      if(value >= this.allowedValues.max()) return(this.allowedValues.max());
-      if(value <= this.allowedValues.min()) return(this.allowedValues.min());
-      
-      var offset = Math.abs(this.allowedValues[0] - value);
-      var newValue = this.allowedValues[0];
-      this.allowedValues.each( function(v) {
-        var currentOffset = Math.abs(v - value);
-        if(currentOffset <= offset){
-          newValue = v;
-          offset = currentOffset;
-        } 
-      });
-      return newValue;
-    }
-    if(value > this.range.end) return this.range.end;
-    if(value < this.range.start) return this.range.start;
-    return value;
-  },
-  setValue: function(sliderValue, handleIdx){
-    if(!this.active) {
-      this.activeHandle    = this.handles[handleIdx];
-      this.activeHandleIdx = handleIdx;
-      this.updateStyles();
-    }
-    handleIdx = handleIdx || this.activeHandleIdx || 0;
-    if(this.initialized && this.restricted) {
-      if((handleIdx>0) && (sliderValue<this.values[handleIdx-1]))
-        sliderValue = this.values[handleIdx-1];
-      if((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1]))
-        sliderValue = this.values[handleIdx+1];
-    }
-    sliderValue = this.getNearestValue(sliderValue);
-    this.values[handleIdx] = sliderValue;
-    this.value = this.values[0]; // assure backwards compat
-    
-    this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = 
-      this.translateToPx(sliderValue);
-    
-    this.drawSpans();
-    if(!this.dragging || !this.event) this.updateFinished();
-  },
-  setValueBy: function(delta, handleIdx) {
-    this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta, 
-      handleIdx || this.activeHandleIdx || 0);
-  },
-  translateToPx: function(value) {
-    return Math.round(
-      ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * 
-      (value - this.range.start)) + "px";
-  },
-  translateToValue: function(offset) {
-    return ((offset/(this.trackLength-this.handleLength) * 
-      (this.range.end-this.range.start)) + this.range.start);
-  },
-  getRange: function(range) {
-    var v = this.values.sortBy(Prototype.K); 
-    range = range || 0;
-    return $R(v[range],v[range+1]);
-  },
-  minimumOffset: function(){
-    return(this.isVertical() ? this.alignY : this.alignX);
-  },
-  maximumOffset: function(){
-    return(this.isVertical() ?
-      this.track.offsetHeight - this.alignY : this.track.offsetWidth - this.alignX);
-  },  
-  isVertical:  function(){
-    return (this.axis == 'vertical');
-  },
-  drawSpans: function() {
-    var slider = this;
-    if(this.spans)
-      $R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) });
-    if(this.options.startSpan)
-      this.setSpan(this.options.startSpan,
-        $R(0, this.values.length>1 ? this.getRange(0).min() : this.value ));
-    if(this.options.endSpan)
-      this.setSpan(this.options.endSpan, 
-        $R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum));
-  },
-  setSpan: function(span, range) {
-    if(this.isVertical()) {
-      span.style.top = this.translateToPx(range.start);
-      span.style.height = this.translateToPx(range.end - range.start + this.range.start);
-    } else {
-      span.style.left = this.translateToPx(range.start);
-      span.style.width = this.translateToPx(range.end - range.start + this.range.start);
-    }
-  },
-  updateStyles: function() {
-    this.handles.each( function(h){ Element.removeClassName(h, 'selected') });
-    Element.addClassName(this.activeHandle, 'selected');
-  },
-  startDrag: function(event) {
-    if(Event.isLeftClick(event)) {
-      if(!this.disabled){
-        this.active = true;
-        
-        var handle = Event.element(event);
-        var pointer  = [Event.pointerX(event), Event.pointerY(event)];
-        if(handle==this.track) {
-          var offsets  = Position.cumulativeOffset(this.track); 
-          this.event = event;
-          this.setValue(this.translateToValue( 
-           (this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2)
-          ));
-          var offsets  = Position.cumulativeOffset(this.activeHandle);
-          this.offsetX = (pointer[0] - offsets[0]);
-          this.offsetY = (pointer[1] - offsets[1]);
-        } else {
-          // find the handle (prevents issues with Safari)
-          while((this.handles.indexOf(handle) == -1) && handle.parentNode) 
-            handle = handle.parentNode;
-        
-          this.activeHandle    = handle;
-          this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
-          this.updateStyles();
-        
-          var offsets  = Position.cumulativeOffset(this.activeHandle);
-          this.offsetX = (pointer[0] - offsets[0]);
-          this.offsetY = (pointer[1] - offsets[1]);
-        }
-      }
-      Event.stop(event);
-    }
-  },
-  update: function(event) {
-   if(this.active) {
-      if(!this.dragging) this.dragging = true;
-      this.draw(event);
-      // fix AppleWebKit rendering
-      if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);
-      Event.stop(event);
-   }
-  },
-  draw: function(event) {
-    var pointer = [Event.pointerX(event), Event.pointerY(event)];
-    var offsets = Position.cumulativeOffset(this.track);
-    pointer[0] -= this.offsetX + offsets[0];
-    pointer[1] -= this.offsetY + offsets[1];
-    this.event = event;
-    this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] ));
-    if(this.initialized && this.options.onSlide)
-      this.options.onSlide(this.values.length>1 ? this.values : this.value, this);
-  },
-  endDrag: function(event) {
-    if(this.active && this.dragging) {
-      this.finishDrag(event, true);
-      Event.stop(event);
-    }
-    this.active = false;
-    this.dragging = false;
-  },  
-  finishDrag: function(event, success) {
-    this.active = false;
-    this.dragging = false;
-    this.updateFinished();
-  },
-  updateFinished: function() {
-    if(this.initialized && this.options.onChange) 
-      this.options.onChange(this.values.length>1 ? this.values : this.value, this);
-    this.event = null;
-  }
-}
diff --git a/view/js/cropper/lib/unittest.js b/view/js/cropper/lib/unittest.js
deleted file mode 100644 (file)
index be0d252..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-//           (c) 2005 Jon Tirsen (http://www.tirsen.com)
-//           (c) 2005 Michael Schuerig (http://www.schuerig.de/michael/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-// experimental, Firefox-only
-Event.simulateMouse = function(element, eventName) {
-  var options = Object.extend({
-    pointerX: 0,
-    pointerY: 0,
-    buttons: 0
-  }, arguments[2] || {});
-  var oEvent = document.createEvent("MouseEvents");
-  oEvent.initMouseEvent(eventName, true, true, document.defaultView, 
-    options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY, 
-    false, false, false, false, 0, $PR(element));
-  
-  if(this.mark) Element.remove(this.mark);
-  this.mark = document.createElement('div');
-  this.mark.appendChild(document.createTextNode(" "));
-  document.body.appendChild(this.mark);
-  this.mark.style.position = 'absolute';
-  this.mark.style.top = options.pointerY + "px";
-  this.mark.style.left = options.pointerX + "px";
-  this.mark.style.width = "5px";
-  this.mark.style.height = "5px;";
-  this.mark.style.borderTop = "1px solid red;"
-  this.mark.style.borderLeft = "1px solid red;"
-  
-  if(this.step)
-    alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options));
-  
-  $PR(element).dispatchEvent(oEvent);
-};
-
-// Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2.
-// You need to downgrade to 1.0.4 for now to get this working
-// See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much
-Event.simulateKey = function(element, eventName) {
-  var options = Object.extend({
-    ctrlKey: false,
-    altKey: false,
-    shiftKey: false,
-    metaKey: false,
-    keyCode: 0,
-    charCode: 0
-  }, arguments[2] || {});
-
-  var oEvent = document.createEvent("KeyEvents");
-  oEvent.initKeyEvent(eventName, true, true, window, 
-    options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,
-    options.keyCode, options.charCode );
-  $PR(element).dispatchEvent(oEvent);
-};
-
-Event.simulateKeys = function(element, command) {
-  for(var i=0; i<command.length; i++) {
-    Event.simulateKey(element,'keypress',{charCode:command.charCodeAt(i)});
-  }
-};
-
-var Test = {}
-Test.Unit = {};
-
-// security exception workaround
-Test.Unit.inspect = Object.inspect;
-
-Test.Unit.Logger = Class.create();
-Test.Unit.Logger.prototype = {
-  initialize: function(log) {
-    this.log = $PR(log);
-    if (this.log) {
-      this._createLogTable();
-    }
-  },
-  start: function(testName) {
-    if (!this.log) return;
-    this.testName = testName;
-    this.lastLogLine = document.createElement('tr');
-    this.statusCell = document.createElement('td');
-    this.nameCell = document.createElement('td');
-    this.nameCell.appendChild(document.createTextNode(testName));
-    this.messageCell = document.createElement('td');
-    this.lastLogLine.appendChild(this.statusCell);
-    this.lastLogLine.appendChild(this.nameCell);
-    this.lastLogLine.appendChild(this.messageCell);
-    this.loglines.appendChild(this.lastLogLine);
-  },
-  finish: function(status, summary) {
-    if (!this.log) return;
-    this.lastLogLine.className = status;
-    this.statusCell.innerHTML = status;
-    this.messageCell.innerHTML = this._toHTML(summary);
-  },
-  message: function(message) {
-    if (!this.log) return;
-    this.messageCell.innerHTML = this._toHTML(message);
-  },
-  summary: function(summary) {
-    if (!this.log) return;
-    this.logsummary.innerHTML = this._toHTML(summary);
-  },
-  _createLogTable: function() {
-    this.log.innerHTML =
-    '<div id="logsummary"></div>' +
-    '<table id="logtable">' +
-    '<thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead>' +
-    '<tbody id="loglines"></tbody>' +
-    '</table>';
-    this.logsummary = $PR('logsummary')
-    this.loglines = $PR('loglines');
-  },
-  _toHTML: function(txt) {
-    return txt.escapeHTML().replace(/\n/g,"<br/>");
-  }
-}
-
-Test.Unit.Runner = Class.create();
-Test.Unit.Runner.prototype = {
-  initialize: function(testcases) {
-    this.options = Object.extend({
-      testLog: 'testlog'
-    }, arguments[1] || {});
-    this.options.resultsURL = this.parseResultsURLQueryParameter();
-    if (this.options.testLog) {
-      this.options.testLog = $PR(this.options.testLog) || null;
-    }
-    if(this.options.tests) {
-      this.tests = [];
-      for(var i = 0; i < this.options.tests.length; i++) {
-        if(/^test/.test(this.options.tests[i])) {
-          this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"]));
-        }
-      }
-    } else {
-      if (this.options.test) {
-        this.tests = [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])];
-      } else {
-        this.tests = [];
-        for(var testcase in testcases) {
-          if(/^test/.test(testcase)) {
-            this.tests.push(new Test.Unit.Testcase(testcase, testcases[testcase], testcases["setup"], testcases["teardown"]));
-          }
-        }
-      }
-    }
-    this.currentTest = 0;
-    this.logger = new Test.Unit.Logger(this.options.testLog);
-    setTimeout(this.runTests.bind(this), 1000);
-  },
-  parseResultsURLQueryParameter: function() {
-    return window.location.search.parseQuery()["resultsURL"];
-  },
-  // Returns:
-  //  "ERROR" if there was an error,
-  //  "FAILURE" if there was a failure, or
-  //  "SUCCESS" if there was neither
-  getResult: function() {
-    var hasFailure = false;
-    for(var i=0;i<this.tests.length;i++) {
-      if (this.tests[i].errors > 0) {
-        return "ERROR";
-      }
-      if (this.tests[i].failures > 0) {
-        hasFailure = true;
-      }
-    }
-    if (hasFailure) {
-      return "FAILURE";
-    } else {
-      return "SUCCESS";
-    }
-  },
-  postResults: function() {
-    if (this.options.resultsURL) {
-      new Ajax.Request(this.options.resultsURL, 
-        { method: 'get', parameters: 'result=' + this.getResult(), asynchronous: false });
-    }
-  },
-  runTests: function() {
-    var test = this.tests[this.currentTest];
-    if (!test) {
-      // finished!
-      this.postResults();
-      this.logger.summary(this.summary());
-      return;
-    }
-    if(!test.isWaiting) {
-      this.logger.start(test.name);
-    }
-    test.run();
-    if(test.isWaiting) {
-      this.logger.message("Waiting for " + test.timeToWait + "ms");
-      setTimeout(this.runTests.bind(this), test.timeToWait || 1000);
-    } else {
-      this.logger.finish(test.status(), test.summary());
-      this.currentTest++;
-      // tail recursive, hopefully the browser will skip the stackframe
-      this.runTests();
-    }
-  },
-  summary: function() {
-    var assertions = 0;
-    var failures = 0;
-    var errors = 0;
-    var messages = [];
-    for(var i=0;i<this.tests.length;i++) {
-      assertions +=   this.tests[i].assertions;
-      failures   +=   this.tests[i].failures;
-      errors     +=   this.tests[i].errors;
-    }
-    return (
-      this.tests.length + " tests, " + 
-      assertions + " assertions, " + 
-      failures   + " failures, " +
-      errors     + " errors");
-  }
-}
-
-Test.Unit.Assertions = Class.create();
-Test.Unit.Assertions.prototype = {
-  initialize: function() {
-    this.assertions = 0;
-    this.failures   = 0;
-    this.errors     = 0;
-    this.messages   = [];
-  },
-  summary: function() {
-    return (
-      this.assertions + " assertions, " + 
-      this.failures   + " failures, " +
-      this.errors     + " errors" + "\n" +
-      this.messages.join("\n"));
-  },
-  pass: function() {
-    this.assertions++;
-  },
-  fail: function(message) {
-    this.failures++;
-    this.messages.push("Failure: " + message);
-  },
-  info: function(message) {
-    this.messages.push("Info: " + message);
-  },
-  error: function(error) {
-    this.errors++;
-    this.messages.push(error.name + ": "+ error.message + "(" + Test.Unit.inspect(error) +")");
-  },
-  status: function() {
-    if (this.failures > 0) return 'failed';
-    if (this.errors > 0) return 'error';
-    return 'passed';
-  },
-  assert: function(expression) {
-    var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"';
-    try { expression ? this.pass() : 
-      this.fail(message); }
-    catch(e) { this.error(e); }
-  },
-  assertEqual: function(expected, actual) {
-    var message = arguments[2] || "assertEqual";
-    try { (expected == actual) ? this.pass() :
-      this.fail(message + ': expected "' + Test.Unit.inspect(expected) + 
-        '", actual "' + Test.Unit.inspect(actual) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertEnumEqual: function(expected, actual) {
-    var message = arguments[2] || "assertEnumEqual";
-    try { $A(expected).length == $A(actual).length && 
-      expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ?
-        this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) + 
-          ', actual ' + Test.Unit.inspect(actual)); }
-    catch(e) { this.error(e); }
-  },
-  assertNotEqual: function(expected, actual) {
-    var message = arguments[2] || "assertNotEqual";
-    try { (expected != actual) ? this.pass() : 
-      this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertNull: function(obj) {
-    var message = arguments[1] || 'assertNull'
-    try { (obj==null) ? this.pass() : 
-      this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertHidden: function(element) {
-    var message = arguments[1] || 'assertHidden';
-    this.assertEqual("none", element.style.display, message);
-  },
-  assertNotNull: function(object) {
-    var message = arguments[1] || 'assertNotNull';
-    this.assert(object != null, message);
-  },
-  assertInstanceOf: function(expected, actual) {
-    var message = arguments[2] || 'assertInstanceOf';
-    try { 
-      (actual instanceof expected) ? this.pass() : 
-      this.fail(message + ": object was not an instance of the expected type"); }
-    catch(e) { this.error(e); } 
-  },
-  assertNotInstanceOf: function(expected, actual) {
-    var message = arguments[2] || 'assertNotInstanceOf';
-    try { 
-      !(actual instanceof expected) ? this.pass() : 
-      this.fail(message + ": object was an instance of the not expected type"); }
-    catch(e) { this.error(e); } 
-  },
-  _isVisible: function(element) {
-    element = $PR(element);
-    if(!element.parentNode) return true;
-    this.assertNotNull(element);
-    if(element.style && Element.getStyle(element, 'display') == 'none')
-      return false;
-    
-    return this._isVisible(element.parentNode);
-  },
-  assertNotVisible: function(element) {
-    this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1]));
-  },
-  assertVisible: function(element) {
-    this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1]));
-  },
-  benchmark: function(operation, iterations) {
-    var startAt = new Date();
-    (iterations || 1).times(operation);
-    var timeTaken = ((new Date())-startAt);
-    this.info((arguments[2] || 'Operation') + ' finished ' + 
-       iterations + ' iterations in ' + (timeTaken/1000)+'s' );
-    return timeTaken;
-  }
-}
-
-Test.Unit.Testcase = Class.create();
-Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), {
-  initialize: function(name, test, setup, teardown) {
-    Test.Unit.Assertions.prototype.initialize.bind(this)();
-    this.name           = name;
-    this.test           = test || function() {};
-    this.setup          = setup || function() {};
-    this.teardown       = teardown || function() {};
-    this.isWaiting      = false;
-    this.timeToWait     = 1000;
-  },
-  wait: function(time, nextPart) {
-    this.isWaiting = true;
-    this.test = nextPart;
-    this.timeToWait = time;
-  },
-  run: function() {
-    try {
-      try {
-        if (!this.isWaiting) this.setup.bind(this)();
-        this.isWaiting = false;
-        this.test.bind(this)();
-      } finally {
-        if(!this.isWaiting) {
-          this.teardown.bind(this)();
-        }
-      }
-    }
-    catch(e) { this.error(e); }
-  }
-});
diff --git a/view/js/cropper/licence.txt b/view/js/cropper/licence.txt
deleted file mode 100644 (file)
index b59e029..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Copyright (c) 2006, David Spurr (www.defusion.org.uk)\r
-All rights reserved.\r
-\r
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r
-\r
-    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
-    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r
-    * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-http://www.opensource.org/licenses/bsd-license.php
\ No newline at end of file
diff --git a/view/js/cropper/marqueeHoriz.gif b/view/js/cropper/marqueeHoriz.gif
deleted file mode 100644 (file)
index 25317e5..0000000
Binary files a/view/js/cropper/marqueeHoriz.gif and /dev/null differ
diff --git a/view/js/cropper/marqueeVert.gif b/view/js/cropper/marqueeVert.gif
deleted file mode 100644 (file)
index 354070b..0000000
Binary files a/view/js/cropper/marqueeVert.gif and /dev/null differ
diff --git a/view/js/cropper/tests/castle.jpg b/view/js/cropper/tests/castle.jpg
deleted file mode 100644 (file)
index e40b7e4..0000000
Binary files a/view/js/cropper/tests/castle.jpg and /dev/null differ
diff --git a/view/js/cropper/tests/castleMed.jpg b/view/js/cropper/tests/castleMed.jpg
deleted file mode 100644 (file)
index c35a6f5..0000000
Binary files a/view/js/cropper/tests/castleMed.jpg and /dev/null differ
diff --git a/view/js/cropper/tests/example-Basic.htm b/view/js/cropper/tests/example-Basic.htm
deleted file mode 100644 (file)
index 2a55eca..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>Basic cropper test</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               // setup the callback function\r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // basic example\r
-               Event.observe( \r
-                       window, \r
-                       'load', \r
-                       function() { \r
-                               new Cropper.Img( \r
-                                       'testImage',\r
-                                       {\r
-                                               onEndCrop: onEndCrop \r
-                                       }\r
-                               ) \r
-                       }\r
-               );              \r
-               \r
-               \r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               \r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               html, body { \r
-                       margin: 0;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-       </style>\r
-</head>\r
-<body>\r
-       <h2>Basic cropper test</h2>\r
-       <p>\r
-               Some test content before the image\r
-       </p>\r
-       \r
-       <div id="testWrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       \r
-       <p>\r
-               <label for="x1">x1:</label>\r
-               <input type="text" name="x1" id="x1" />\r
-       </p>\r
-       <p>\r
-               <label for="y1">y1:</label>\r
-               <input type="text" name="y1" id="y1" />\r
-       </p>\r
-       <p>\r
-               <label for="x2">x2:</label>\r
-               <input type="text" name="x2" id="x2" />\r
-       </p>\r
-       <p>\r
-               <label for="y2">y2:</label>\r
-               <input type="text" name="y2" id="y2" />\r
-       </p>\r
-       <p>\r
-               <label for="width">width:</label>\r
-               <input type="text" name="width" id="width" />\r
-       </p>\r
-       <p>\r
-               <label for="height">height</label>\r
-               <input type="text" name="height" id="height" />\r
-       </p>  \r
-       \r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-CSS-Absolute.htm b/view/js/cropper/tests/example-CSS-Absolute.htm
deleted file mode 100644 (file)
index b605fd3..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>CSS - Absolute positioned (and draggable) test</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop,effects" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               // setup the callback function\r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-                               \r
-               // Absolute positioned example\r
-               Event.observe(\r
-                       window,\r
-                       'load',\r
-                       function() {\r
-                               new Cropper.Img( 'testAbsImage', { onEndCrop: onEndCrop } );\r
-                               new Draggable( 'test-abs' );\r
-                       }\r
-               );              \r
-               \r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               \r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               html, body { \r
-                       margin: 0;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-               \r
-               #test-abs {\r
-                       width: 510px;\r
-                       position: absolute;\r
-                       top: 50px;\r
-                       left: 25%;\r
-                       background-color: #dee;\r
-                       border: 3px solid #ccc;\r
-                       z-index: 10;\r
-               }\r
-       </style>\r
-</head>\r
-<body>\r
-       <h2>CSS - Absolute positioned (and draggable) test</h2>\r
-       <p>\r
-               Some test content before the image\r
-       </p>\r
-       <p>\r
-       Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque consequat risus cursus ipsum. Etiam libero. Integer vel mauris. Donec vulputate. In ut augue vitae nibh lobortis tempor. Aliquam hendrerit quam. Phasellus sed orci. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut sed urna. Donec nunc urna, porttitor a, feugiat pellentesque, varius id, justo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Sed sollicitudin. Integer enim. Aenean sollicitudin.\r
-       </p>\r
-       <p>\r
-       Integer lorem turpis, dapibus sed, vulputate nec, volutpat a, sem. Sed malesuada laoreet lorem. Duis mauris ipsum, fringilla nec, tristique vel, imperdiet vel, neque. Nulla vel purus. Fusce non lectus. Mauris pulvinar. Curabitur eget eros. Nunc ultrices, risus vitae adipiscing scelerisque, quam mi auctor lacus, non pellentesque augue sapien a magna. Etiam rutrum posuere tortor. Mauris rhoncus sagittis dolor. Donec sed quam. Vivamus vel diam id massa adipiscing bibendum. Suspendisse potenti. Integer arcu est, adipiscing sit amet, convallis eu, sollicitudin tincidunt, quam.\r
-       </p>\r
-       <p>\r
-       Etiam ligula lorem, imperdiet ac, luctus eget, ultrices at, odio. Vivamus malesuada, justo eu adipiscing semper, nisi dui tempus magna, quis ultrices nunc tellus id massa. Nullam lobortis auctor sapien. Quisque non nulla. Donec lobortis pellentesque nisl. Sed lacus sapien, viverra vitae, blandit ut, fermentum quis, leo. Morbi augue turpis, hendrerit non, feugiat vel, laoreet sed, est. Nunc velit. Praesent lobortis. Integer enim. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur faucibus lacus ac ante. Donec odio odio, tincidunt a, egestas nec, scelerisque nec, dui. Cras sollicitudin. Donec lacus enim, mollis sit amet, interdum quis, euismod et, nulla. Nunc sit amet dui eu magna dapibus mollis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla facilisi.\r
-       </p>\r
-       <p>\r
-       In hac habitasse platea dictumst. Nunc neque urna, dapibus ut, tristique ut, bibendum ac, felis. Donec dictum est ut dolor. Etiam accumsan, velit sit amet blandit vestibulum, turpis quam hendrerit risus, vel interdum eros orci in nunc. Curabitur tellus sapien, rutrum ac, euismod ac, malesuada nec, pede. Proin sit amet ipsum. Praesent quam nisl, adipiscing nec, tristique eget, fermentum sed, est. Praesent ac est sit amet orci facilisis placerat. Sed consequat, est sit amet consectetuer viverra, risus urna porttitor tellus, ut convallis nibh libero in lectus. Pellentesque molestie, erat non vehicula pretium, turpis nisi eleifend eros, sed scelerisque tortor odio non tellus. Nunc leo tellus, faucibus vitae, placerat a, accumsan vel, arcu. In et orci. Ut tristique euismod nibh. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Sed nulla nunc, placerat vitae, pellentesque non, interdum non, sapien. Quisque faucibus, eros sed venenatis sagittis, leo risus rhoncus risus, in pretium sem purus a lacus. Aliquam aliquam leo et diam.\r
-       \r
-       </p>\r
-       <p>\r
-       Nulla sagittis diam. Phasellus vitae enim tristique libero molestie tristique. Nam mauris sem, elementum nec, cursus in, fringilla ac, neque. Nunc metus nisi, dictum vel, vulputate quis, porttitor bibendum, tortor. Vestibulum vehicula. Nulla facilisi. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla ac magna sed purus ultricies euismod. Aliquam dictum. Sed mauris. Suspendisse justo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi purus lorem, auctor non, porta ac, vehicula vel, orci. Morbi pharetra massa nec leo. Maecenas et mauris. Aliquam porttitor tincidunt nulla. Vestibulum pede.\r
-       </p>\r
-       <p>\r
-       Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque consequat risus cursus ipsum. Etiam libero. Integer vel mauris. Donec vulputate. In ut augue vitae nibh lobortis tempor. Aliquam hendrerit quam. Phasellus sed orci. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut sed urna. Donec nunc urna, porttitor a, feugiat pellentesque, varius id, justo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Sed sollicitudin. Integer enim. Aenean sollicitudin.\r
-       </p>\r
-       <p>\r
-       Integer lorem turpis, dapibus sed, vulputate nec, volutpat a, sem. Sed malesuada laoreet lorem. Duis mauris ipsum, fringilla nec, tristique vel, imperdiet vel, neque. Nulla vel purus. Fusce non lectus. Mauris pulvinar. Curabitur eget eros. Nunc ultrices, risus vitae adipiscing scelerisque, quam mi auctor lacus, non pellentesque augue sapien a magna. Etiam rutrum posuere tortor. Mauris rhoncus sagittis dolor. Donec sed quam. Vivamus vel diam id massa adipiscing bibendum. Suspendisse potenti. Integer arcu est, adipiscing sit amet, convallis eu, sollicitudin tincidunt, quam.\r
-       </p>\r
-       <p>\r
-       Etiam ligula lorem, imperdiet ac, luctus eget, ultrices at, odio. Vivamus malesuada, justo eu adipiscing semper, nisi dui tempus magna, quis ultrices nunc tellus id massa. Nullam lobortis auctor sapien. Quisque non nulla. Donec lobortis pellentesque nisl. Sed lacus sapien, viverra vitae, blandit ut, fermentum quis, leo. Morbi augue turpis, hendrerit non, feugiat vel, laoreet sed, est. Nunc velit. Praesent lobortis. Integer enim. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur faucibus lacus ac ante. Donec odio odio, tincidunt a, egestas nec, scelerisque nec, dui. Cras sollicitudin. Donec lacus enim, mollis sit amet, interdum quis, euismod et, nulla. Nunc sit amet dui eu magna dapibus mollis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla facilisi.\r
-       </p>\r
-       <p>\r
-       In hac habitasse platea dictumst. Nunc neque urna, dapibus ut, tristique ut, bibendum ac, felis. Donec dictum est ut dolor. Etiam accumsan, velit sit amet blandit vestibulum, turpis quam hendrerit risus, vel interdum eros orci in nunc. Curabitur tellus sapien, rutrum ac, euismod ac, malesuada nec, pede. Proin sit amet ipsum. Praesent quam nisl, adipiscing nec, tristique eget, fermentum sed, est. Praesent ac est sit amet orci facilisis placerat. Sed consequat, est sit amet consectetuer viverra, risus urna porttitor tellus, ut convallis nibh libero in lectus. Pellentesque molestie, erat non vehicula pretium, turpis nisi eleifend eros, sed scelerisque tortor odio non tellus. Nunc leo tellus, faucibus vitae, placerat a, accumsan vel, arcu. In et orci. Ut tristique euismod nibh. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Sed nulla nunc, placerat vitae, pellentesque non, interdum non, sapien. Quisque faucibus, eros sed venenatis sagittis, leo risus rhoncus risus, in pretium sem purus a lacus. Aliquam aliquam leo et diam.\r
-       \r
-       </p>\r
-       <p>\r
-       Nulla sagittis diam. Phasellus vitae enim tristique libero molestie tristique. Nam mauris sem, elementum nec, cursus in, fringilla ac, neque. Nunc metus nisi, dictum vel, vulputate quis, porttitor bibendum, tortor. Vestibulum vehicula. Nulla facilisi. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla ac magna sed purus ultricies euismod. Aliquam dictum. Sed mauris. Suspendisse justo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi purus lorem, auctor non, porta ac, vehicula vel, orci. Morbi pharetra massa nec leo. Maecenas et mauris. Aliquam porttitor tincidunt nulla. Vestibulum pede.\r
-       </p>\r
-       <p>\r
-       Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque consequat risus cursus ipsum. Etiam libero. Integer vel mauris. Donec vulputate. In ut augue vitae nibh lobortis tempor. Aliquam hendrerit quam. Phasellus sed orci. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut sed urna. Donec nunc urna, porttitor a, feugiat pellentesque, varius id, justo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Sed sollicitudin. Integer enim. Aenean sollicitudin.\r
-       </p>\r
-       <p>\r
-       Integer lorem turpis, dapibus sed, vulputate nec, volutpat a, sem. Sed malesuada laoreet lorem. Duis mauris ipsum, fringilla nec, tristique vel, imperdiet vel, neque. Nulla vel purus. Fusce non lectus. Mauris pulvinar. Curabitur eget eros. Nunc ultrices, risus vitae adipiscing scelerisque, quam mi auctor lacus, non pellentesque augue sapien a magna. Etiam rutrum posuere tortor. Mauris rhoncus sagittis dolor. Donec sed quam. Vivamus vel diam id massa adipiscing bibendum. Suspendisse potenti. Integer arcu est, adipiscing sit amet, convallis eu, sollicitudin tincidunt, quam.\r
-       </p>\r
-       <p>\r
-       Etiam ligula lorem, imperdiet ac, luctus eget, ultrices at, odio. Vivamus malesuada, justo eu adipiscing semper, nisi dui tempus magna, quis ultrices nunc tellus id massa. Nullam lobortis auctor sapien. Quisque non nulla. Donec lobortis pellentesque nisl. Sed lacus sapien, viverra vitae, blandit ut, fermentum quis, leo. Morbi augue turpis, hendrerit non, feugiat vel, laoreet sed, est. Nunc velit. Praesent lobortis. Integer enim. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur faucibus lacus ac ante. Donec odio odio, tincidunt a, egestas nec, scelerisque nec, dui. Cras sollicitudin. Donec lacus enim, mollis sit amet, interdum quis, euismod et, nulla. Nunc sit amet dui eu magna dapibus mollis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla facilisi.\r
-       </p>\r
-       <p>\r
-       In hac habitasse platea dictumst. Nunc neque urna, dapibus ut, tristique ut, bibendum ac, felis. Donec dictum est ut dolor. Etiam accumsan, velit sit amet blandit vestibulum, turpis quam hendrerit risus, vel interdum eros orci in nunc. Curabitur tellus sapien, rutrum ac, euismod ac, malesuada nec, pede. Proin sit amet ipsum. Praesent quam nisl, adipiscing nec, tristique eget, fermentum sed, est. Praesent ac est sit amet orci facilisis placerat. Sed consequat, est sit amet consectetuer viverra, risus urna porttitor tellus, ut convallis nibh libero in lectus. Pellentesque molestie, erat non vehicula pretium, turpis nisi eleifend eros, sed scelerisque tortor odio non tellus. Nunc leo tellus, faucibus vitae, placerat a, accumsan vel, arcu. In et orci. Ut tristique euismod nibh. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Sed nulla nunc, placerat vitae, pellentesque non, interdum non, sapien. Quisque faucibus, eros sed venenatis sagittis, leo risus rhoncus risus, in pretium sem purus a lacus. Aliquam aliquam leo et diam.\r
-       \r
-       </p>\r
-       <p>\r
-       Nulla sagittis diam. Phasellus vitae enim tristique libero molestie tristique. Nam mauris sem, elementum nec, cursus in, fringilla ac, neque. Nunc metus nisi, dictum vel, vulputate quis, porttitor bibendum, tortor. Vestibulum vehicula. Nulla facilisi. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla ac magna sed purus ultricies euismod. Aliquam dictum. Sed mauris. Suspendisse justo. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi purus lorem, auctor non, porta ac, vehicula vel, orci. Morbi pharetra massa nec leo. Maecenas et mauris. Aliquam porttitor tincidunt nulla. Vestibulum pede.\r
-       </p>\r
-\r
-\r
-<div id="test-abs">\r
-       <h2>Absolute test</h2>\r
-       <div id="testAbsWrap">\r
-               <img src="castle.jpg" alt="test image" id="testAbsImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       <p>\r
-               <label for="x1">x1:</label>\r
-               <input type="text" name="x1" id="x1" />\r
-       </p>\r
-       <p>\r
-               <label for="y1">y1:</label>\r
-               <input type="text" name="y1" id="y1" />\r
-       </p>\r
-       <p>\r
-               <label for="x2">x2:</label>\r
-               <input type="text" name="x2" id="x2" />\r
-       </p>\r
-       <p>\r
-               <label for="y2">y2:</label>\r
-               <input type="text" name="y2" id="y2" />\r
-       </p>\r
-       <p>\r
-               <label for="width">width:</label>\r
-               <input type="text" name="width" id="width" />\r
-       </p>\r
-       <p>\r
-               <label for="height">height</label>\r
-               <input type="text" name="height" id="height" />\r
-       </p>  \r
-</div>\r
-\r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-CSS-Float.htm b/view/js/cropper/tests/example-CSS-Float.htm
deleted file mode 100644 (file)
index 3dbeeab..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>CSS - Float test</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               // setup the callback function\r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // float example\r
-               Event.observe(\r
-                       window,\r
-                       'load',\r
-                       function() {\r
-                               new Cropper.Img(\r
-                                       'testFloatImage',\r
-                                       { \r
-                                               onEndCrop: function( coords, dimensions ) {\r
-                                                       $PR( 'floatX1' ).value = coords.x1;\r
-                                                       $PR( 'floatY1' ).value = coords.y1;\r
-                                                       $PR( 'floatX2' ).value = coords.x2;\r
-                                                       $PR( 'floatY2' ).value = coords.y2;\r
-                                                       $PR( 'floatWidth' ).value = dimensions.width;\r
-                                                       $PR( 'floatHeight' ).value = dimensions.height;\r
-                                               }\r
-                                       }\r
-                               );\r
-                       }\r
-               );              \r
-               \r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               \r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               html, body { \r
-                       margin: 0;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-               \r
-               #test-float {\r
-                       width: 600px;\r
-                       float: right;\r
-                       background-color: #eee;\r
-                       border: 3px solid #000;\r
-                       margin: 10px;\r
-                       padding: 5px;\r
-               }\r
-\r
-       </style>\r
-</head>\r
-<body>\r
-       <h2>Test page with floating wrapper</h2>\r
-       <p>\r
-               Some test content before the image\r
-       </p>\r
-\r
-<div id="test-float">\r
-       <h2>Float test</h2>\r
-       <div id="testFloatWrap">\r
-               <img src="castle.jpg" alt="test image" id="testFloatImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       <p>\r
-               <label for="floatX1">x1:</label>\r
-               <input type="text" name="floatX1" id="floatX1" />\r
-       </p>\r
-       <p>\r
-               <label for="floatY1">y1:</label>\r
-               <input type="text" name="floatY1" id="floatY1" />\r
-       </p>\r
-       <p>\r
-               <label for="floatX2">x2:</label>\r
-               <input type="text" name="floatX2" id="floatX2" />\r
-       </p>\r
-       <p>\r
-               <label for="floatY2">y2:</label>\r
-               <input type="text" name="floatY2" id="floatY2" />\r
-       </p>\r
-       <p>\r
-               <label for="floatWidth">width:</label>\r
-               <input type="text" name="floatWidth" id="floatWidth" />\r
-       </p>\r
-       <p>\r
-               <label for="floatHeight">height</label>\r
-               <input type="text" name="floatHeight" id="floatHeight" />\r
-       </p>  \r
-</div>\r
-\r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-CSS-Relative.htm b/view/js/cropper/tests/example-CSS-Relative.htm
deleted file mode 100644 (file)
index ecad134..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>CSS - Relative test</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               // setup the callback function\r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // relative example\r
-               Event.observe( \r
-                       window, \r
-                       'load', \r
-                       function() { \r
-                               new Cropper.Img( \r
-                                       'testImage',\r
-                                       {\r
-                                               onEndCrop: onEndCrop \r
-                                       }\r
-                               ) \r
-                       }\r
-               );      \r
-                               \r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               \r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               html, body { \r
-                       margin: 0;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-               \r
-               #test-relative {\r
-                       background-color: #ccc;\r
-                       border: 3px solid #ddd;\r
-                       position: relative;\r
-                       top: 25px;\r
-                       left: 25px;\r
-               }\r
-       </style>\r
-</head>\r
-<body>\r
-       <h2>Test page with relatively positioned wrapper</h2>\r
-       <p>\r
-               Some test content before the image\r
-       </p>\r
-\r
-<div id="test-relative">\r
-       <h2>Relative test</h2>\r
-       <div id="testWrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       \r
-       <p>\r
-               <label for="x1">x1:</label>\r
-               <input type="text" name="x1" id="x1" />\r
-       </p>\r
-       <p>\r
-               <label for="y1">y1:</label>\r
-               <input type="text" name="y1" id="y1" />\r
-       </p>\r
-       <p>\r
-               <label for="x2">x2:</label>\r
-               <input type="text" name="x2" id="x2" />\r
-       </p>\r
-       <p>\r
-               <label for="y2">y2:</label>\r
-               <input type="text" name="y2" id="y2" />\r
-       </p>\r
-       <p>\r
-               <label for="width">width:</label>\r
-               <input type="text" name="width" id="width" />\r
-       </p>\r
-       <p>\r
-               <label for="height">height</label>\r
-               <input type="text" name="height" id="height" />\r
-       </p>  \r
-</div> \r
-\r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-CoordsOnLoad.htm b/view/js/cropper/tests/example-CoordsOnLoad.htm
deleted file mode 100644 (file)
index c14289c..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>Loading &amp; displaying co-ordinates of crop area on attachment test</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               // setup the callback function\r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // basic example\r
-               Event.observe( \r
-                       window, \r
-                       'load', \r
-                       function() { \r
-                               new Cropper.Img( \r
-                                       'testImage',\r
-                                       {\r
-                                               onEndCrop: onEndCrop,\r
-                                               displayOnInit: true,\r
-                                               onloadCoords: { x1: 10, y1: 10, x2: 250, y2: 100 }\r
-                                       }\r
-                               ) \r
-                       }\r
-               );              \r
-               \r
-               \r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               \r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               html, body { \r
-                       margin: 0;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-       </style>\r
-</head>\r
-<body>\r
-       <h2>Loading &amp; displaying co-ordinates of crop area on attachment test</h2>\r
-       <p>\r
-               Some test content before the image\r
-       </p>\r
-       \r
-       <div id="testWrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       \r
-       <p>\r
-               <label for="x1">x1:</label>\r
-               <input type="text" name="x1" id="x1" />\r
-       </p>\r
-       <p>\r
-               <label for="y1">y1:</label>\r
-               <input type="text" name="y1" id="y1" />\r
-       </p>\r
-       <p>\r
-               <label for="x2">x2:</label>\r
-               <input type="text" name="x2" id="x2" />\r
-       </p>\r
-       <p>\r
-               <label for="y2">y2:</label>\r
-               <input type="text" name="y2" id="y2" />\r
-       </p>\r
-       <p>\r
-               <label for="width">width:</label>\r
-               <input type="text" name="width" id="width" />\r
-       </p>\r
-       <p>\r
-               <label for="height">height</label>\r
-               <input type="text" name="height" id="height" />\r
-       </p>  \r
-       \r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-CoordsOnLoadWithRatio.htm b/view/js/cropper/tests/example-CoordsOnLoadWithRatio.htm
deleted file mode 100644 (file)
index 9ba02da..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>Loading &amp; displaying co-ordinates (with ratio) of crop area on attachment test<</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               // setup the callback function\r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // basic example\r
-               Event.observe( \r
-                       window, \r
-                       'load', \r
-                       function() { \r
-                               new Cropper.Img( \r
-                                       'testImage',\r
-                                       {\r
-                                               onEndCrop: onEndCrop,\r
-                                               displayOnInit: true,\r
-                                               onloadCoords: { x1: 10, y1: 10, x2: 210, y2: 110 },\r
-                                               ratioDim: { x: 200, y: 100 }\r
-                                       }\r
-                               ) \r
-                       }\r
-               );              \r
-               \r
-               \r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               \r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               html, body { \r
-                       margin: 0;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-       </style>\r
-</head>\r
-<body>\r
-       <h2>Loading &amp; displaying co-ordinates (with ratio) of crop area on attachment test</h2>\r
-       <p>\r
-               Some test content before the image\r
-       </p>\r
-       \r
-       <div id="testWrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       \r
-       <p>\r
-               <label for="x1">x1:</label>\r
-               <input type="text" name="x1" id="x1" />\r
-       </p>\r
-       <p>\r
-               <label for="y1">y1:</label>\r
-               <input type="text" name="y1" id="y1" />\r
-       </p>\r
-       <p>\r
-               <label for="x2">x2:</label>\r
-               <input type="text" name="x2" id="x2" />\r
-       </p>\r
-       <p>\r
-               <label for="y2">y2:</label>\r
-               <input type="text" name="y2" id="y2" />\r
-       </p>\r
-       <p>\r
-               <label for="width">width:</label>\r
-               <input type="text" name="width" id="width" />\r
-       </p>\r
-       <p>\r
-               <label for="height">height</label>\r
-               <input type="text" name="height" id="height" />\r
-       </p>  \r
-       \r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-Dimensions.htm b/view/js/cropper/tests/example-Dimensions.htm
deleted file mode 100644 (file)
index 10e5ba2..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
-       <meta http-equiv="Content-Language" content="en-us" />
-       <title>Different dimensions test</title>
-       <script src="../lib/prototype.js" type="text/javascript"></script>      
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
-       <script src="../cropper.js" type="text/javascript"></script>
-       
-       
-       <script type="text/javascript" charset="utf-8">
-               
-               function onEndCrop( coords, dimensions ) {
-                       $PR( 'x1' ).value = coords.x1;
-                       $PR( 'y1' ).value = coords.y1;
-                       $PR( 'x2' ).value = coords.x2;
-                       $PR( 'y2' ).value = coords.y2;
-                       $PR( 'width' ).value = dimensions.width;
-                       $PR( 'height' ).value = dimensions.height;
-               }
-               
-               /*
-               
-               // example with minimum dimensions
-               Event.observe( 
-                       window, 
-                       'load', 
-                       function() { 
-                               new Cropper.Img( 
-                                       'testImage', 
-                                       { 
-                                               minWidth: 200, 
-                                               minHeight: 120,
-                                               maxWidth: 200,
-                                               //maxHeight: 120,
-                                               displayOnInit: true, 
-                                               onEndCrop: onEndCrop 
-                                       } 
-                               ) 
-                       } 
-               );
-               */
-               
-               Event.observe( window, 'load',
-                       function() {
-                               Event.observe( 'dimensionsForm', 'submit', CropManager.attachCropper.bindAsEventListener( CropManager ) );
-                               CropManager.attachCropper();
-                       }
-               );
-               
-               /**
-                * A little manager that allows us to reset the options dynamically
-                */
-               var CropManager = {
-                       /**
-                        * Holds the current Cropper.Img object
-                        * @var obj
-                        */
-                       curCrop: null,
-                       
-                       /**
-                        * Gets a min/max parameter from the form 
-                        * 
-                        * @access private
-                        * @param string Form element ID
-                        * @return int
-                        */
-                       getParam: function( name ) {
-                               var val = $F( name );
-                               console.log( name + ' :: ' + val );
-                               return parseInt( val );
-                       },
-                                                                       
-                       /** 
-                        * Attaches/resets the image cropper
-                        *
-                        * @access private
-                        * @param obj Event object
-                        * @return void
-                        */
-                       attachCropper: function( e ) {
-                               if( this.curCrop == null ) {
-                                       this.curCrop = new Cropper.Img( 
-                                               'testImage', 
-                                               { 
-                                                       minWidth: this.getParam( 'minWidth' ),
-                                                       minHeight: this.getParam( 'minHeight' ),
-                                                       maxWidth: this.getParam( 'maxWidth' ),
-                                                       maxHeight: this.getParam( 'maxHeight' ),
-                                                       onEndCrop: onEndCrop 
-                                               } 
-                                       );
-                               } else {
-                                       this.removeCropper();
-                                       this.curCrop.initialize( 
-                                               'testImage', 
-                                               { 
-                                                       minWidth: this.getParam( 'minWidth' ),
-                                                       minHeight: this.getParam( 'minHeight' ),
-                                                       maxWidth: this.getParam( 'maxWidth' ),
-                                                       maxHeight: this.getParam( 'maxHeight' ),
-                                                       onEndCrop: onEndCrop 
-                                               } 
-                                       );
-                               }
-                               if( e != null ) Event.stop( e );
-                       },
-                       
-                       /**
-                        * Removes the cropper
-                        *
-                        * @access public
-                        * @return void
-                        */
-                       removeCropper: function() {
-                               if( this.curCrop != null ) {
-                                       this.curCrop.remove();
-                               }
-                       },
-                       
-                       /**
-                        * Resets the cropper, either re-setting or re-applying
-                        *
-                        * @access public
-                        * @return void
-                        */
-                       resetCropper: function() {
-                               this.attachCropper();
-                       }
-               };              
-               
-               /*
-               if( typeof(dump) != 'function' ) {
-                       Debug.init(true, '/');
-                       
-                       function dump( msg ) {
-                               // Debug.raise( msg );
-                       };
-               } else dump( '---------------------------------------\n' );
-               */
-               
-       </script>
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />
-       <style type="text/css">
-               label { 
-                       clear: left;
-                       margin-left: 50px;
-                       float: left;
-                       width: 5em;
-               }
-               
-               #testWrap {
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */
-               }
-               
-               #dimensionsForm {
-                       float: right;
-                       width: 350px;
-               }
-       </style>
-</head>
-<body> 
-       <h2>Multiple dimensions tests</h2>
-       <p>
-               Test of applying different dimension restrictions to the cropper
-       </p>
-       
-       <form action="#" id="dimensionsForm">
-               <fieldset>
-                       Set the cropper with the following dimension restrictions:
-                       <p>
-                               <label for="minWidth">Min Width</label>
-                               <input type="text" size="10" maxlength="3" value="200" id="minWidth" name="minWidth" />
-                       </p>    
-                       <p>
-                               <label for="maxWidth">Max Width</label>
-                               <input type="text" size="10" maxlength="3" value="200" id="maxWidth" name="maxWidth" />
-                       </p>    
-                       <p>
-                               <label for="minHeight">Min Height</label>
-                               <input type="text" size="10" maxlength="3" value="120" id="minHeight" name="minHeight" />
-                       </p>    
-                       <p>
-                               <label for="maxHeight">Max Height</label>
-                               <input type="text" size="10" maxlength="3" value="120" id="maxHeight" name="maxHeight" />
-                       </p>    
-                       <input type="submit" value="Set Cropper" />
-               </fieldset>
-       </form>
-       
-       <div id="testWrap">
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />
-       </div>
-       
-       
-       <p>
-               <label for="x1">x1:</label>
-               <input type="text" name="x1" id="x1" />
-       </p>
-       <p>
-               <label for="y1">y1:</label>
-               <input type="text" name="y1" id="y1" />
-       </p>
-       <p>
-               <label for="x2">x2:</label>
-               <input type="text" name="x2" id="x2" />
-       </p>
-       <p>
-               <label for="y2">y2:</label>
-               <input type="text" name="y2" id="y2" />
-       </p>
-       <p>
-               <label for="width">width:</label>
-               <input type="text" name="width" id="width" />
-       </p>
-       <p>
-               <label for="height">height</label>
-               <input type="text" name="height" id="height" />
-       </p>  
-       
-</body>
-</html>
-
-
diff --git a/view/js/cropper/tests/example-DynamicImage.htm b/view/js/cropper/tests/example-DynamicImage.htm
deleted file mode 100644 (file)
index 08240bb..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>Dynamic image test</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               /**\r
-                * A little manager that allows us to swap the image dynamically\r
-                *\r
-                */\r
-               var CropImageManager = {\r
-                       /**\r
-                        * Holds the current Cropper.Img object\r
-                        * @var obj\r
-                        */\r
-                       curCrop: null,\r
-                       \r
-                       /**\r
-                        * Initialises the cropImageManager\r
-                        *\r
-                        * @access public\r
-                        * @return void\r
-                        */\r
-                       init: function() {\r
-                               this.attachCropper();\r
-                       },\r
-                       \r
-                       /**\r
-                        * Handles the changing of the select to change the image, the option value\r
-                        * is a pipe seperated list of imgSrc|width|height\r
-                        * \r
-                        * @access public\r
-                        * @param obj event\r
-                        * @return void\r
-                        */\r
-                       onChange: function( e ) {\r
-                               var vals = $F( Event.element( e ) ).split('|');\r
-                               this.setImage( vals[0], vals[1], vals[2] ); \r
-                       },\r
-                       \r
-                       /**\r
-                        * Sets the image within the element & attaches/resets the image cropper\r
-                        *\r
-                        * @access private\r
-                        * @param string Source path of new image\r
-                        * @param int Width of new image in pixels\r
-                        * @param int Height of new image in pixels\r
-                        * @return void\r
-                        */\r
-                       setImage: function( imgSrc, w, h ) {\r
-                               $PR( 'testImage' ).src = imgSrc;\r
-                               $PR( 'testImage' ).width = w;\r
-                               $PR( 'testImage' ).height = h;\r
-                               this.attachCropper();\r
-                       },\r
-                       \r
-                       /** \r
-                        * Attaches/resets the image cropper\r
-                        *\r
-                        * @access private\r
-                        * @return void\r
-                        */\r
-                       attachCropper: function() {\r
-                               if( this.curCrop == null ) this.curCrop = new Cropper.Img( 'testImage', { onEndCrop: onEndCrop } );\r
-                               else this.curCrop.reset();\r
-                       },\r
-                       \r
-                       /**\r
-                        * Removes the cropper\r
-                        *\r
-                        * @access public\r
-                        * @return void\r
-                        */\r
-                       removeCropper: function() {\r
-                               if( this.curCrop != null ) {\r
-                                       this.curCrop.remove();\r
-                               }\r
-                       },\r
-                       \r
-                       /**\r
-                        * Resets the cropper, either re-setting or re-applying\r
-                        *\r
-                        * @access public\r
-                        * @return void\r
-                        */\r
-                       resetCropper: function() {\r
-                               this.attachCropper();\r
-                       }\r
-               };\r
-               \r
-               \r
-               // setup the callback function\r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // basic example\r
-               Event.observe( \r
-                       window, \r
-                       'load', \r
-                       function() { \r
-                               CropImageManager.init();\r
-                               Event.observe( $PR('removeCropper'), 'click', CropImageManager.removeCropper.bindAsEventListener( CropImageManager ), false );\r
-                               Event.observe( $PR('resetCropper'), 'click', CropImageManager.resetCropper.bindAsEventListener( CropImageManager ), false );\r
-                               Event.observe( $PR('imageChoice'), 'change', CropImageManager.onChange.bindAsEventListener( CropImageManager ), false );\r
-                       }\r
-               );              \r
-               \r
-               \r
-               /*\r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               */\r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               html, body { \r
-                       margin: 0;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-       </style>\r
-</head>\r
-<body>\r
-       <h2>Dynamic image test</h2>\r
-       <p>\r
-               Test of dynamically changing images or removing & re-applying the cropper\r
-       </p>\r
-       \r
-       <div id="testWrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       <p>\r
-               <label for="imageChoice">image:</label>\r
-               <select name="imageChoice" id="imageChoice">\r
-                       <option value="castle.jpg|500|333">Castle</option>\r
-                       <option value="poppy.jpg|311|466">Flower</option>\r
-               </select>\r
-       </p>\r
-       \r
-       <p>\r
-               <input type="button" id="removeCropper" value="Remove Cropper" />\r
-               <input type="button" id="resetCropper" value="Reset Cropper" />\r
-       </p>\r
-       \r
-       \r
-       <p>\r
-               <label for="x1">x1:</label>\r
-               <input type="text" name="x1" id="x1" />\r
-       </p>\r
-       <p>\r
-               <label for="y1">y1:</label>\r
-               <input type="text" name="y1" id="y1" />\r
-       </p>\r
-       <p>\r
-               <label for="x2">x2:</label>\r
-               <input type="text" name="x2" id="x2" />\r
-       </p>\r
-       <p>\r
-               <label for="y2">y2:</label>\r
-               <input type="text" name="y2" id="y2" />\r
-       </p>\r
-       <p>\r
-               <label for="width">width:</label>\r
-               <input type="text" name="width" id="width" />\r
-       </p>\r
-       <p>\r
-               <label for="height">height</label>\r
-               <input type="text" name="height" id="height" />\r
-       </p>  \r
-       \r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-FixedRatio.htm b/view/js/cropper/tests/example-FixedRatio.htm
deleted file mode 100644 (file)
index 8d196c1..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>Fixed ratio test</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // with a supplied ratio\r
-               Event.observe( \r
-                       window, \r
-                       'load', \r
-                       function() { \r
-                               new Cropper.Img( \r
-                                       'testImage', \r
-                                       { \r
-                                               ratioDim: { x: 220, y: 124 }, \r
-                                               displayOnInit: true, \r
-                                               onEndCrop: onEndCrop \r
-                                       } \r
-                               ) \r
-                       } \r
-               );\r
-               \r
-               /*\r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               // Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               */\r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-       </style>\r
-</head>\r
-<body> \r
-       <h2>Fixed ratio test</h2>\r
-       <p>\r
-               Test of applying a fixed ratio to the cropper\r
-       </p>\r
-       <br />\r
-       \r
-       <div id="testWrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       \r
-       <p>\r
-               <label for="x1">x1:</label>\r
-               <input type="text" name="x1" id="x1" />\r
-       </p>\r
-       <p>\r
-               <label for="y1">y1:</label>\r
-               <input type="text" name="y1" id="y1" />\r
-       </p>\r
-       <p>\r
-               <label for="x2">x2:</label>\r
-               <input type="text" name="x2" id="x2" />\r
-       </p>\r
-       <p>\r
-               <label for="y2">y2:</label>\r
-               <input type="text" name="y2" id="y2" />\r
-       </p>\r
-       <p>\r
-               <label for="width">width:</label>\r
-               <input type="text" name="width" id="width" />\r
-       </p>\r
-       <p>\r
-               <label for="height">height</label>\r
-               <input type="text" name="height" id="height" />\r
-       </p>  \r
-       \r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-MinimumDimensions.htm b/view/js/cropper/tests/example-MinimumDimensions.htm
deleted file mode 100644 (file)
index e6d96b3..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>Min dimensions test</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // example with minimum dimensions\r
-               Event.observe( \r
-                       window, \r
-                       'load', \r
-                       function() { \r
-                               new Cropper.Img( \r
-                                       'testImage', \r
-                                       { \r
-                                               minWidth: 200, \r
-                                               minHeight: 120, \r
-                                               displayOnInit: true, \r
-                                               onEndCrop: onEndCrop \r
-                                       } \r
-                               ) \r
-                       } \r
-               );\r
-               \r
-               /*\r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               // Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               */\r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-       </style>\r
-</head>\r
-<body> \r
-       <h2>Minimum (both axes ) dimension test</h2>\r
-       <p>\r
-               Test of applying a minimum dimension to both axes to the cropper\r
-       </p>\r
-       <br />\r
-       \r
-       <div id="testWrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       \r
-       <p>\r
-               <label for="x1">x1:</label>\r
-               <input type="text" name="x1" id="x1" />\r
-       </p>\r
-       <p>\r
-               <label for="y1">y1:</label>\r
-               <input type="text" name="y1" id="y1" />\r
-       </p>\r
-       <p>\r
-               <label for="x2">x2:</label>\r
-               <input type="text" name="x2" id="x2" />\r
-       </p>\r
-       <p>\r
-               <label for="y2">y2:</label>\r
-               <input type="text" name="y2" id="y2" />\r
-       </p>\r
-       <p>\r
-               <label for="width">width:</label>\r
-               <input type="text" name="width" id="width" />\r
-       </p>\r
-       <p>\r
-               <label for="height">height</label>\r
-               <input type="text" name="height" id="height" />\r
-       </p>  \r
-       \r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-MinimumWidth.htm b/view/js/cropper/tests/example-MinimumWidth.htm
deleted file mode 100644 (file)
index ec5d696..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title>Min (single axis) dimensions test</title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // example with minimum dimensions\r
-               Event.observe( \r
-                       window, \r
-                       'load', \r
-                       function() { \r
-                               new Cropper.Img( \r
-                                       'testImage', \r
-                                       { \r
-                                               minWidth: 200, \r
-                                               displayOnInit: true, \r
-                                               onEndCrop: onEndCrop \r
-                                       } \r
-                               ) \r
-                       } \r
-               );\r
-               \r
-               /*\r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               // Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               */\r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               #testWrap {\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-       </style>\r
-</head>\r
-<body> \r
-       <h2>Minimum (single axis) dimension test</h2>\r
-       <p>\r
-               Test of applying a minimum dimension to only one axis (width in this case) to the cropper\r
-       </p>\r
-       <br />\r
-       <br /><br />\r
-       \r
-       <div id="testWrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       \r
-       <p>\r
-               <label for="x1">x1:</label>\r
-               <input type="text" name="x1" id="x1" />\r
-       </p>\r
-       <p>\r
-               <label for="y1">y1:</label>\r
-               <input type="text" name="y1" id="y1" />\r
-       </p>\r
-       <p>\r
-               <label for="x2">x2:</label>\r
-               <input type="text" name="x2" id="x2" />\r
-       </p>\r
-       <p>\r
-               <label for="y2">y2:</label>\r
-               <input type="text" name="y2" id="y2" />\r
-       </p>\r
-       <p>\r
-               <label for="width">width:</label>\r
-               <input type="text" name="width" id="width" />\r
-       </p>\r
-       <p>\r
-               <label for="height">height</label>\r
-               <input type="text" name="height" id="height" />\r
-       </p>  \r
-       \r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/example-Preview.htm b/view/js/cropper/tests/example-Preview.htm
deleted file mode 100644 (file)
index 51bf260..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title></title>\r
-       <script src="../lib/prototype.js" type="text/javascript"></script>      \r
-       <script src="../lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>\r
-       <script src="../cropper.js" type="text/javascript"></script>\r
-       \r
-       \r
-       <script type="text/javascript" charset="utf-8">\r
-               \r
-               function onEndCrop( coords, dimensions ) {\r
-                       $PR( 'x1' ).value = coords.x1;\r
-                       $PR( 'y1' ).value = coords.y1;\r
-                       $PR( 'x2' ).value = coords.x2;\r
-                       $PR( 'y2' ).value = coords.y2;\r
-                       $PR( 'width' ).value = dimensions.width;\r
-                       $PR( 'height' ).value = dimensions.height;\r
-               }\r
-               \r
-               // example with a preview of crop results, must have minimumm dimensions\r
-               Event.observe( \r
-                       window, \r
-                       'load', \r
-                       function() { \r
-                               new Cropper.ImgWithPreview( \r
-                                       'testImage',\r
-                                       { \r
-                                               minWidth: 200, \r
-                                               minHeight: 120,\r
-                                               ratioDim: { x: 200, y: 120 },\r
-                                               displayOnInit: true, \r
-                                               onEndCrop: onEndCrop,\r
-                                               previewWrap: 'previewArea'\r
-                                       } \r
-                               ) \r
-                       } \r
-               );\r
-               \r
-               /*\r
-               if( typeof(dump) != 'function' ) {\r
-                       Debug.init(true, '/');\r
-                       \r
-                       function dump( msg ) {\r
-                               // Debug.raise( msg );\r
-                       };\r
-               } else dump( '---------------------------------------\n' );\r
-               */\r
-               \r
-       </script>\r
-       <link rel="stylesheet" type="text/css" href="debug.css" media="all" />\r
-       <style type="text/css">\r
-               label { \r
-                       clear: left;\r
-                       margin-left: 50px;\r
-                       float: left;\r
-                       width: 5em;\r
-               }\r
-               \r
-               #testWrap {\r
-                       width: 500px;\r
-                       float: left;\r
-                       margin: 20px 0 0 50px; /* Just while testing, to make sure we return the correct positions for the image & not the window */\r
-               }\r
-               \r
-               #previewArea {\r
-                       margin: 20px; 0 0 20px;\r
-                       float: left;\r
-               }\r
-               \r
-               #results {\r
-                       clear: both;\r
-               }\r
-       </style>\r
-</head>\r
-<body> \r
-       <br /><br />\r
-       \r
-       <div id="testWrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-       </div>\r
-       \r
-       <div id="previewArea"></div>\r
-       \r
-       <div id="results">\r
-               <p>\r
-                       <label for="x1">x1:</label>\r
-                       <input type="text" name="x1" id="x1" />\r
-               </p>\r
-               <p>\r
-                       <label for="y1">y1:</label>\r
-                       <input type="text" name="y1" id="y1" />\r
-               </p>\r
-               <p>\r
-                       <label for="x2">x2:</label>\r
-                       <input type="text" name="x2" id="x2" />\r
-               </p>\r
-               <p>\r
-                       <label for="y2">y2:</label>\r
-                       <input type="text" name="y2" id="y2" />\r
-               </p>\r
-               <p>\r
-                       <label for="width">width:</label>\r
-                       <input type="text" name="width" id="width" />\r
-               </p>\r
-               <p>\r
-                       <label for="height">height</label>\r
-                       <input type="text" name="height" id="height" />\r
-               </p>\r
-       </div> \r
-       \r
-</body>\r
-</html>\r
-\r
-\r
diff --git a/view/js/cropper/tests/poppy.jpg b/view/js/cropper/tests/poppy.jpg
deleted file mode 100644 (file)
index 1f64985..0000000
Binary files a/view/js/cropper/tests/poppy.jpg and /dev/null differ
diff --git a/view/js/cropper/tests/staticHTMLStructure.htm b/view/js/cropper/tests/staticHTMLStructure.htm
deleted file mode 100644 (file)
index ddb9927..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
-       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Content-Language" content="en-us" />\r
-       <title></title>\r
-</head>\r
-<body>\r
-       <!--\r
-               \r
-               This is a static test file for the HTML & CSS structure employed, tested in \r
-               the following browsers:\r
-               \r
-                       PC:\r
-                               IE 6:          working\r
-                               IE 5.5:        working\r
-                               IE 5.0:        opacity issues\r
-                               FF 1.5:        working\r
-                               Opera 9:       working\r
-                       MAC:\r
-                               Camino 1.0:    working\r
-                               FF 1.5:        working\r
-                               Safari 2.0:    working\r
-                               \r
-       -->     \r
-       <style type="text/css">         \r
-               .imgCrop_wrap {\r
-                       width: 500px;   /* @TODO IN JS */\r
-                       height: 333px;  /* @TODO IN JS */\r
-                       position: relative;\r
-                       cursor: crosshair;\r
-               }\r
-               \r
-               /* fix for IE displaying all boxes at line-height by default */\r
-               .imgCrop_wrap,\r
-               .imgCrop_wrap * {\r
-                       font-size: 0;\r
-               }\r
-               \r
-               .imgCrop_overlay {\r
-                       background-color: #000;\r
-                       opacity: 0.5;\r
-                       filter:alpha(opacity=50);\r
-                       position: absolute;\r
-                       width: 100%;\r
-                       height: 100%;\r
-               }\r
-               \r
-               .imgCrop_selArea {\r
-                       position: absolute;\r
-                       cursor: move;\r
-                       /* @TODO: rest to be done via JS when selecting areas */\r
-                       top: 110px;\r
-                       left: 210px;\r
-                       width: 200px;\r
-                       height: 200px;\r
-                       z-index: 2;\r
-                       background: transparent url(castle.jpg) no-repeat  -210px -110px;\r
-               }\r
-               \r
-               /* imgCrop_clickArea is all a fix for IE 5.5 & 6 to allow the user to click on the given area */\r
-               .imgCrop_clickArea {\r
-                       width: 100%;\r
-                       height: 100%;\r
-                       background-color: #FFF;\r
-                       opacity: 0.01;\r
-                       filter:alpha(opacity=01);\r
-               }\r
-                               \r
-               .imgCrop_marqueeHoriz {\r
-                       position: absolute;\r
-                       width: 100%;\r
-                       height: 1px;\r
-                       background: transparent url(marqueeHoriz.gif) repeat-x 0 0;\r
-               }\r
-               \r
-               .imgCrop_marqueeVert {\r
-                       position: absolute;\r
-                       height: 100%;\r
-                       width: 1px;\r
-                       background: transparent url(marqueeVert.gif) repeat-y 0 0;\r
-               }\r
-                               \r
-               .imgCrop_marqueeNorth { top: 0; left: 0; }\r
-               .imgCrop_marqueeEast  { top: 0; right: 0; }\r
-               .imgCrop_marqueeSouth { bottom: 0px; left: 0; }\r
-               .imgCrop_marqueeWest  { top: 0; left: 0; }\r
-               \r
-               \r
-               .imgCrop_handle {\r
-                       position: absolute;\r
-                       border: 1px solid #333;\r
-                       width: 6px;\r
-                       height: 6px;\r
-                       background: #FFF;\r
-                       opacity: 0.5;\r
-                       filter:alpha(opacity=50);\r
-                       z-index: 3;\r
-               }\r
-               \r
-               .imgCrop_handleN {\r
-                       top: -3px;\r
-                       left: 0;\r
-                       margin-left: 49%;    /* @TODO : in JS */\r
-                       cursor: n-resize;\r
-               }\r
-               \r
-               .imgCrop_handleNE { \r
-                       top: -3px;\r
-                       right: -3px;\r
-                       cursor: ne-resize;\r
-               }\r
-               \r
-               .imgCrop_handleE {\r
-                       top: 0;\r
-                       right: -3px;\r
-                       margin-top: 49%;    /* @TODO : in JS */\r
-                       cursor: e-resize;\r
-               }\r
-               \r
-               .imgCrop_handleSE {\r
-                       right: -3px;\r
-                       bottom: -3px;\r
-                       cursor: se-resize;\r
-               }\r
-               \r
-               .imgCrop_handleS {\r
-                       right: 0;\r
-                       bottom: -3px;\r
-                       margin-right: 49%; /* @TODO : in JS */\r
-                       cursor: s-resize;\r
-               }\r
-               \r
-               .imgCrop_handleSW {\r
-                       left: -3px;\r
-                       bottom: -3px;\r
-                       cursor: sw-resize;\r
-               }\r
-               \r
-               .imgCrop_handleW {\r
-                       top: 0;\r
-                       left: -3px;\r
-                       margin-top: 49%;  /* @TODO : in JS */\r
-                       cursor: e-resize;\r
-               }\r
-               \r
-               .imgCrop_handleNW {\r
-                       top: -3px;\r
-                       left: -3px;\r
-                       cursor: nw-resize;\r
-               }\r
-               \r
-               /**\r
-                * Create an area to click & drag around on as the default browser behaviour is to let you drag the image \r
-                */\r
-               .imgCrop_dragArea {\r
-                       width: 100%;\r
-                       height: 100%;\r
-                       z-index: 200;\r
-                       position: absolute;\r
-                       top: 0;\r
-                       left: 0;\r
-               }\r
-               \r
-               \r
-               .imgCrop_previewWrap {\r
-                       width: 200px;  /* @TODO : in JS */\r
-                       height: 200px; /* @TODO : in JS */\r
-                       overflow: hidden;\r
-                       position: relative;\r
-               }\r
-               \r
-               /* @TODO : all in JS */\r
-               .imgCrop_previewWrap img {\r
-                       position: absolute;\r
-                       width: 500px;\r
-                       height: 333px;\r
-                       left: -210px;\r
-                       top: -110px;\r
-               }\r
-               \r
-               /**\r
-                * These are just for the static test\r
-                */\r
-               .imgCrop_wrap {\r
-                       margin: 20px 0 0 50px;\r
-                       float: left;\r
-               }\r
-               \r
-               #previewWrapper {\r
-                       float: left;\r
-                       margin-left: 20px;\r
-               }\r
-               \r
-                       \r
-       </style>\r
-       \r
-       <br /><br />\r
-       \r
-       <!-- This is all attached to the image dynamically -->\r
-       <div class="imgCrop_wrap">\r
-               <img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />\r
-               <div class="imgCrop_dragArea">\r
-                       <div class="imgCrop_overlay"></div>\r
-                       <div class="imgCrop_selArea">\r
-                               <!-- marquees -->\r
-                               <!-- the inner spans are only required for IE to stop it making the divs 1px high/wide -->\r
-                               <div class="imgCrop_marqueeHoriz imgCrop_marqueeNorth"><span></span></div>\r
-                               <div class="imgCrop_marqueeVert imgCrop_marqueeEast"><span></span></div>\r
-                               <div class="imgCrop_marqueeHoriz imgCrop_marqueeSouth"><span></span></div>\r
-                               <div class="imgCrop_marqueeVert imgCrop_marqueeWest"><span></span></div>                        \r
-                               <!-- handles -->\r
-                               <div class="imgCrop_handle imgCrop_handleN"></div>\r
-                               <div class="imgCrop_handle imgCrop_handleNE"></div>\r
-                               <div class="imgCrop_handle imgCrop_handleE"></div>\r
-                               <div class="imgCrop_handle imgCrop_handleSE"></div>\r
-                               <div class="imgCrop_handle imgCrop_handleS"></div>\r
-                               <div class="imgCrop_handle imgCrop_handleSW"></div>\r
-                               <div class="imgCrop_handle imgCrop_handleW"></div>\r
-                               <div class="imgCrop_handle imgCrop_handleNW"></div>\r
-                               <div class="imgCrop_clickArea"></div>\r
-                       </div>  \r
-                       <div class="imgCrop_clickArea"></div>   \r
-               </div>  \r
-       </div>\r
-       \r
-       <div id="previewWrapper">\r
-               <h3>Preview:</h3>\r
-               <div class="imgCrop_previewWrap">\r
-                       <img src="castle.jpg" alt="test image" id="previewImage" />\r
-               </div>\r
-       </div>\r
-</body>\r
-</html>\r
-\r
-\r
index 4cf030bc9d5124cafeab38b4350d90708b8d9ee0..5fedfd0df46cfa5e4061cd3f720d0279707ac426 100644 (file)
@@ -1,58 +1,54 @@
 <h1>{{$title}}</h1>
 <p id="cropimage-desc">
-{{$desc}}
+       {{$desc}}
 </p>
+
 <div id="cropimage-wrapper">
-<img src="{{$image_url}}" id="croppa" class="imgCrop" alt="{{$title}}" />
+       <img src="{{$image_url}}" id="croppa" class="imgCrop" alt="{{$title}}" />
 </div>
+
 <div id="cropimage-preview-wrapper" >
-<div id="previewWrap" ></div>
+       <div id="previewWrap" class="crop-preview"></div>
 </div>
 
 <script type="text/javascript" language="javascript">
 
-       function onEndCrop( coords, dimensions ) {
-               $PR( 'x1' ).value = coords.x1;
-               $PR( 'y1' ).value = coords.y1;
-               $PR( 'x2' ).value = coords.x2;
-               $PR( 'y2' ).value = coords.y2;
-               $PR( 'width' ).value = dimensions.width;
-               $PR( 'height' ).value = dimensions.height;
-       }
-
-       Event.observe( window, 'load', function() {
-               new Cropper.ImgWithPreview(
-               'croppa',
-               {
-                       previewWrap: 'previewWrap',
-                       minWidth: 175,
-                       minHeight: 175,
-                       maxWidth: 640,
-                       maxHeight: 640,
-                       ratioDim: { x: 100, y:100 },
-                       displayOnInit: true,
-                       onEndCrop: onEndCrop
-               }
-               );
-       }
-       );
+               var image = document.getElementById('croppa');
+               var cropper = new Cropper(image, {
+                       aspectRatio: 1 / 1,
+                       viewMode: 1,
+                       preview: '#profile-photo-wrapper, .crop-preview',
+                       crop: function(e) {
+                               $( '#x1' ).val(e.detail.x);
+                               $( '#y1' ).val(e.detail.y);
+                               $( '#x2' ).val(e.detail.x + e.detail.width);
+                               $( '#y2' ).val(e.detail.y + e.detail.height);
+                               $( '#width' ).val(e.detail.scaleX);
+                               $( '#height' ).val(e.detail.scaleY);
+                       },
+                       ready: function() {
+                               // Add the "crop-preview" class to the preview element ("profile-photo-wrapper").
+                               var cwrapper = document.getElementById("profile-photo-wrapper");
+                               cwrapper.classList.add("crop-preview");
+                       }
+               });
 
 </script>
 
 <form action="profile_photo/{{$resource}}" id="crop-image-form" method="post" />
-<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
-
-<input type='hidden' name='profile' value='{{$profile}}'>
-<input type="hidden" name="cropfinal" value="1" />
-<input type="hidden" name="xstart" id="x1" />
-<input type="hidden" name="ystart" id="y1" />
-<input type="hidden" name="xfinal" id="x2" />
-<input type="hidden" name="yfinal" id="y2" />
-<input type="hidden" name="height" id="height" />
-<input type="hidden" name="width"  id="width" />
-
-<div id="crop-image-submit-wrapper" >
-<input type="submit" name="submit" value="{{$done|escape:'html'}}" />
-</div>
+       <input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
+
+       <input type='hidden' name='profile' value='{{$profile}}'>
+       <input type="hidden" name="cropfinal" value="1" />
+       <input type="hidden" name="xstart" id="x1" />
+       <input type="hidden" name="ystart" id="y1" />
+       <input type="hidden" name="xfinal" id="x2" />
+       <input type="hidden" name="yfinal" id="y2" />
+       <input type="hidden" name="height" id="height" />
+       <input type="hidden" name="width"  id="width" />
+
+       <div id="crop-image-submit-wrapper" >
+               <input type="submit" name="submit" value="{{$done|escape:'html'}}" />
+       </div>
 
 </form>
index 033f2e410144df151b5a7853c13ec1cd49f8c19f..d6fc84567385d6e608799f19bd0ff861763a1918 100644 (file)
@@ -1,4 +1,2 @@
-      <script type="text/javascript" src="view/js/cropper/lib/prototype.js" language="javascript"></script>
-      <script type="text/javascript" src="view/js/cropper/lib/scriptaculous.js?load=effects,builder,dragdrop" language="javascript"></script>
-      <script type="text/javascript" src="view/js/cropper/cropper.js" language="javascript"></script>
-      <link rel="stylesheet" href="view/js/cropper/cropper.css" type="text/css" />
+<script type="text/javascript" src="vendor/fengyuanchen/cropperjs/dist/cropper.min.js"></script>
+<link rel="stylesheet" href="vendor/fengyuanchen/cropperjs/dist/cropper.min.css" type="text/css" />
index 728a55b9ca52650c9ed475d6e8bf690838642631..84ea6db94bde599452394bd77bf984d66a0b50ca 100644 (file)
@@ -726,6 +726,9 @@ input#dfrn-url {
        height:175px;
        padding: 12px;
 }
+#profile-photo-wrapper.crop-preview img {
+       padding: 0;
+}
 
 #profile-edit-profile-name-label,
 #profile-edit-name-label,
index 99fde33099502aac347d7eb289208ee4553faccc..312bee263eb0340486216d4d9c210591c604b499 100644 (file)
@@ -1087,6 +1087,9 @@ color: rgba(255,255,255,.85);
 aside .vcard #profile-photo-wrapper:hover .tool .action {
     opacity: 1;
 }
+aside .vcard #profile-photo-wrapper.crop-preview {
+    padding: 0;
+}
 aside .vcard .profile-header {
     margin-bottom: 20px;
 }