From 2e1909fdb64de357adbd17f280cb761caae4591f Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 3 Aug 2012 03:56:14 +0200 Subject: Added missing upload library. --- start.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/start.php b/start.php index 376c7985d..17ce067d7 100644 --- a/start.php +++ b/start.php @@ -49,16 +49,12 @@ function tidypics_init() { $js_base = 'mod/tidypics/vendors/jquery-file-upload/js'; - elgg_register_js('jquery-tmpl', "http://blueimp.github.com/JavaScript-Templates/tmpl.js", 'footer'); + elgg_register_js('jquery-tmpl', "$js_base/vendor/tmpl.min.js", 'footer'); elgg_register_js('jquery-load-image', "$js_base/vendor/load-image.min.js", 'footer'); elgg_register_js('jquery-canvas-to-blob', "$js_base/vendor/canvas-to-blob.min.js", 'footer'); - elgg_register_js('jquery-image-gallery', "$js_base/vendor/jquery.image-gallery.min.js", 'footer'); - elgg_register_js('jquery-iframe-transport', "$js_base/jquery.iframe-transport.js", 'footer'); elgg_register_js('jquery-fileupload', "$js_base/jquery.fileupload.js", 'footer'); - elgg_register_js('jquery-fileupload-fp', "$js_base/jquery.fileupload-fp.js", 'footer'); elgg_register_js('jquery-fileupload-ui', "$js_base/jquery.fileupload-ui.js", 'footer'); - elgg_register_js('jquery-fileupload-jui', "$js_base/jquery.fileupload-jui.js", 'footer'); // Add photos link to owner block/hover menus elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'tidypics_owner_block_menu'); -- cgit v1.2.3 From 33416279ddc8a483126ce5a04c0c361fa984dfb6 Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 3 Aug 2012 04:06:44 +0200 Subject: Finally uploaded missing file. --- views/default/js/photos/upload.php | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 views/default/js/photos/upload.php 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 @@ + + +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); -- cgit v1.2.3 From a5f23d31518e5b8f00293fde8bc2fbdd481d574b Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 3 Aug 2012 23:35:38 +0200 Subject: Drop files from desktop disabled (wasn't working). --- views/default/js/photos/upload.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/views/default/js/photos/upload.php b/views/default/js/photos/upload.php index 05421125d..82e2696bd 100644 --- a/views/default/js/photos/upload.php +++ b/views/default/js/photos/upload.php @@ -3,6 +3,9 @@ * */ +$maxfilesize = (int) elgg_get_plugin_setting('maxfilesize', 'tidypics'); +$maxfilesize *= 1024; + ?> elgg.provide('elgg.tidypics.upload'); @@ -41,12 +44,15 @@ elgg.tidypics.upload.init = function() { // Settings $('#fileupload').fileupload('option', { - maxFileSize: 5000000, + maxFileSize: , acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, change: function() { elgg.tidypics.upload.fileinput.hide().appendTo($('#fileupload')); elgg.tidypics.upload.fileinput = $('#fileupload .elgg-input-file'); }, + drop: function () { + return false; + } }); elgg.tidypics.upload.fileinput = $('#fileupload .elgg-input-file'); -- cgit v1.2.3