diff options
author | Sem <sembrestels@riseup.net> | 2012-08-03 04:06:44 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-08-03 04:06:44 +0200 |
commit | 33416279ddc8a483126ce5a04c0c361fa984dfb6 (patch) | |
tree | 7b3c04b429ac68aa2baf744780728dbc9f5b03ef /views/default/js | |
parent | 2e1909fdb64de357adbd17f280cb761caae4591f (diff) | |
download | elgg-33416279ddc8a483126ce5a04c0c361fa984dfb6.tar.gz elgg-33416279ddc8a483126ce5a04c0c361fa984dfb6.tar.bz2 |
Finally uploaded missing file.
Diffstat (limited to 'views/default/js')
-rw-r--r-- | views/default/js/photos/upload.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/views/default/js/photos/upload.php b/views/default/js/photos/upload.php new file mode 100644 index 000000000..05421125d --- /dev/null +++ b/views/default/js/photos/upload.php @@ -0,0 +1,55 @@ +<?php +/** + * + */ + +?> + +elgg.provide('elgg.tidypics.upload'); + +elgg.tidypics.upload.init = function() { + + window.locale = { + "fileupload": { + "error": elgg.echo('tidypics:upload:error'), + "errors": { + "maxFileSize": elgg.echo('tidypics:upload:maxfilesize'), + "minFileSize": elgg.echo('tidypics:upload:minfilesize'), + "acceptFileTypes": elgg.echo('tidypics:upload:acceptfiletypes'), + "maxNumberOfFiles": elgg.echo('tidypics:upload:maxnumberoffiles'), + }, + } + }; + + $.widget('blueimpJUI.fileupload', $.blueimpUI.fileupload, { + _transition: function (node) { + var that = this, + deferred = $.Deferred(); + if (node.hasClass('fade')) { + node.fadeToggle(function () { + deferred.resolveWith(node); + }); + } else { + deferred.resolveWith(node); + } + return deferred; + }, + }); + + // Initialize the jQuery File Upload widget: + $('#fileupload').fileupload(); + + // Settings + $('#fileupload').fileupload('option', { + maxFileSize: 5000000, + acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, + change: function() { + elgg.tidypics.upload.fileinput.hide().appendTo($('#fileupload')); + elgg.tidypics.upload.fileinput = $('#fileupload .elgg-input-file'); + }, + }); + + elgg.tidypics.upload.fileinput = $('#fileupload .elgg-input-file'); +}; + +elgg.register_hook_handler('init', 'system', elgg.tidypics.upload.init); |