diff --git a/js/jcrop/Jcrop.gif b/js/jcrop/Jcrop.gif deleted file mode 100644 index 72ea7ccb53..0000000000 Binary files a/js/jcrop/Jcrop.gif and /dev/null differ diff --git a/js/jcrop/jquery.Jcrop.css b/js/jcrop/jquery.Jcrop.css deleted file mode 100644 index b95178a726..0000000000 --- a/js/jcrop/jquery.Jcrop.css +++ /dev/null @@ -1,45 +0,0 @@ -/* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */ -.jcrop-holder -{ - text-align: left; -} - -.jcrop-vline, .jcrop-hline -{ - font-size: 0; - position: absolute; - background: white url('Jcrop.gif') top left repeat; - /* - opacity: .5; - *filter:alpha(opacity=50); - */ -} -.jcrop-vline { height: 100%; width: 1px !important; } -.jcrop-hline { width: 100%; height: 1px !important; } -.jcrop-handle { - font-size: 1px; - width: 7px !important; - height: 7px !important; - border: 1px #eee solid; - background-color: #333; - *width: 9px; - *height: 9px; -} - -.jcrop-tracker { - *background-color: gray; - width: 100%; height: 100%; -} - -.custom .jcrop-vline, -.custom .jcrop-hline -{ - background: yellow; -} -.custom .jcrop-handle -{ - border-color: black; - background-color: #C7BB00; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; -} diff --git a/js/jcrop/jquery.Jcrop.go.js b/js/jcrop/jquery.Jcrop.go.js deleted file mode 100644 index 7c5b5e4e66..0000000000 --- a/js/jcrop/jquery.Jcrop.go.js +++ /dev/null @@ -1,41 +0,0 @@ - $(function(){ - jQuery("#avatar_original img.avatar").Jcrop({ onChange: showPreview, - setSelect: [ 0, 0, $("#avatar_original img.avatar").attr("width"), $("#avatar_original img.avatar").attr("height") ], - onSelect: updateCoords, - aspectRatio: 1, - boxWidth: 480, - boxHeight: 480, - bgColor: '#000', - bgOpacity: .4 - }); - }); - - function showPreview(coords) { - var rx = 96 / coords.w; - var ry = 96 / coords.h; - - var img_width = $("#avatar_original img.avatar").attr("width"); - var img_height = $("#avatar_original img.avatar").attr("height"); - - - $('#avatar_preview img.avatar').css({ - width: Math.round(rx *img_width) + 'px', - height: Math.round(ry * img_height) + 'px', - marginLeft: '-' + Math.round(rx * coords.x) + 'px', - marginTop: '-' + Math.round(ry * coords.y) + 'px' - }); - }; - - function updateCoords(c) { - $('#avatar_crop_x').val(c.x); - $('#avatar_crop_y').val(c.y); - $('#avatar_crop_w').val(c.w); - $('#avatar_crop_h').val(c.h); - }; - - function checkCoords() { - if (parseInt($('#avatar_crop_w').val())) return true; - alert('Please select a crop region then press submit.'); - return false; - }; - diff --git a/js/jquery.Jcrop.go.js b/js/jquery.Jcrop.go.js new file mode 100644 index 0000000000..e5d5873545 --- /dev/null +++ b/js/jquery.Jcrop.go.js @@ -0,0 +1,41 @@ + $(function(){ + jQuery("#photo_original img").Jcrop({ + onChange: showPreview, + setSelect: [ 0, 0, $("#photo_original img").attr("width"), $("#photo_original img").attr("height") ], + onSelect: updateCoords, + aspectRatio: 1, + boxWidth: 480, + boxHeight: 480, + bgColor: '#000', + bgOpacity: .4 + }); + }); + + function showPreview(coords) { + var rx = 96 / coords.w; + var ry = 96 / coords.h; + + var img_width = $("#photo_original img").attr("width"); + var img_height = $("#photo_original img").attr("height"); + + $('#photo_preview img').css({ + width: Math.round(rx *img_width) + 'px', + height: Math.round(ry * img_height) + 'px', + marginLeft: '-' + Math.round(rx * coords.x) + 'px', + marginTop: '-' + Math.round(ry * coords.y) + 'px' + }); + }; + + function updateCoords(c) { + $('#photo_crop_x').val(c.x); + $('#photo_crop_y').val(c.y); + $('#photo_crop_w').val(c.w); + $('#photo_crop_h').val(c.h); + }; + + function checkCoords() { + if (parseInt($('#photo_crop_w').val())) return true; + alert('Please select a crop region then press submit.'); + return false; + }; + diff --git a/js/jcrop/jquery.Jcrop.pack.js b/js/jquery.Jcrop.pack.js similarity index 100% rename from js/jcrop/jquery.Jcrop.pack.js rename to js/jquery.Jcrop.pack.js diff --git a/js/jquery.form.js b/js/jquery.form.js deleted file mode 100644 index cb8b5a6609..0000000000 --- a/js/jquery.form.js +++ /dev/null @@ -1,632 +0,0 @@ -/* - * jQuery Form Plugin - * version: 2.17 (06-NOV-2008) - * @requires jQuery v1.2.2 or later - * - * Examples and documentation at: http://malsup.com/jquery/form/ - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - * Revision: $Id$ - */ -;(function($) { - -/* - Usage Note: - ----------- - Do not use both ajaxSubmit and ajaxForm on the same form. These - functions are intended to be exclusive. Use ajaxSubmit if you want - to bind your own submit handler to the form. For example, - - $(document).ready(function() { - $('#myForm').bind('submit', function() { - $(this).ajaxSubmit({ - target: '#output' - }); - return false; // <-- important! - }); - }); - - Use ajaxForm when you want the plugin to manage all the event binding - for you. For example, - - $(document).ready(function() { - $('#myForm').ajaxForm({ - target: '#output' - }); - }); - - When using ajaxForm, the ajaxSubmit function will be invoked for you - at the appropriate time. -*/ - -/** - * ajaxSubmit() provides a mechanism for immediately submitting - * an HTML form using AJAX. - */ -$.fn.ajaxSubmit = function(options) { - // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) - if (!this.length) { - log('ajaxSubmit: skipping submit process - no element selected'); - return this; - } - - if (typeof options == 'function') - options = { success: options }; - - options = $.extend({ - url: this.attr('action') || window.location.toString(), - type: this.attr('method') || 'GET' - }, options || {}); - - // hook for manipulating the form data before it is extracted; - // convenient for use with rich editors like tinyMCE or FCKEditor - var veto = {}; - this.trigger('form-pre-serialize', [this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); - return this; - } - - // provide opportunity to alter form data before it is serialized - if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSerialize callback'); - return this; - } - - var a = this.formToArray(options.semantic); - if (options.data) { - options.extraData = options.data; - for (var n in options.data) { - if(options.data[n] instanceof Array) { - for (var k in options.data[n]) - a.push( { name: n, value: options.data[n][k] } ) - } - else - a.push( { name: n, value: options.data[n] } ); - } - } - - // give pre-submit callback an opportunity to abort the submit - if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSubmit callback'); - return this; - } - - // fire vetoable 'validate' event - this.trigger('form-submit-validate', [a, this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); - return this; - } - - var q = $.param(a); - - if (options.type.toUpperCase() == 'GET') { - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else - options.data = q; // data is the query string for 'post' - - var $form = this, callbacks = []; - if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); - if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function(){}; - callbacks.push(function(data) { - $(options.target).html(data).each(oldSuccess, arguments); - }); - } - else if (options.success) - callbacks.push(options.success); - - options.success = function(data, status) { - for (var i=0, max=callbacks.length; i < max; i++) - callbacks[i].apply(options, [data, status, $form]); - }; - - // are there files to upload? - var files = $('input:file', this).fieldValue(); - var found = false; - for (var j=0; j < files.length; j++) - if (files[j]) - found = true; - - // options.iframe allows user to force iframe mode - if (options.iframe || found) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if ($.browser.safari && options.closeKeepAlive) - $.get(options.closeKeepAlive, fileUpload); - else - fileUpload(); - } - else - $.ajax(options); - - // fire 'notify' event - this.trigger('form-submit-notify', [this, options]); - return this; - - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUpload() { - var form = $form[0]; - - if ($(':input[@name=submit]', form).length) { - alert('Error: Form elements must not be named "submit".'); - return; - } - - var opts = $.extend({}, $.ajaxSettings, options); - var s = jQuery.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts); - - var id = 'jqFormIO' + (new Date().getTime()); - var $io = $('