Skip to content

Commit

Permalink
Update fileupload dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
compojoom committed May 25, 2020
1 parent 2b1ab8a commit 824ac19
Show file tree
Hide file tree
Showing 12 changed files with 3,247 additions and 3,081 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Changelog lib_compojoom

5.3.1
# updated fileupload dependency

+ added advancedlist custom field (allows users to have multiple select lists and use other native joomla jform list features)
# fix for a bug in Joomla 3.6 https://github.com/joomla/joomla-cms/commit/4cf1dbdbcecab85b4331861aaa633d359bca9617

Expand Down Expand Up @@ -55,4 +58,4 @@ see git history

1.0.0

+ initial release
+ initial release
2 changes: 1 addition & 1 deletion source/libraries/compojoom/compojoom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<authorUrl>https://compojoom.com</authorUrl>
<copyright>(C) 2008 - 2017 Daniel Dimitrov and Yves Hoppe</copyright>
<license>GNU GPLv2 or later</license>
<version>5.3.0</version>
<version>5.3.1</version>

<languages folder="language">
<language tag="en-GB">en-GB/en-GB.lib_compojoom.ini</language>
Expand Down
3 changes: 2 additions & 1 deletion source/libraries/compojoom/layouts/galleria/galleria.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<script type="text/javascript">
Galleria.run('.galleria', {
dataSource: <?php echo $displayData['data']; ?>
dataSource: <?php echo $displayData['data']; ?>,
imageCrop: true
});
</script>
176 changes: 82 additions & 94 deletions source/media/lib_compojoom/js/jquery.fileupload-audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,105 +9,93 @@
* https://opensource.org/licenses/MIT
*/

/* jshint nomen:false */
/* global define, require, window, document */
/* global define, require */

;(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'load-image',
'./jquery.fileupload-process'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('blueimp-load-image/js/load-image'),
require('./jquery.fileupload-process')
);
} else {
// Browser globals:
factory(
window.jQuery,
window.loadImage
);
}
}(function ($, loadImage) {
'use strict';

// Prepend to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.unshift(
{
action: 'loadAudio',
// Use the action as prefix for the "@" options:
prefix: true,
fileTypes: '@',
maxFileSize: '@',
disabled: '@disableAudioPreview'
},
{
action: 'setAudio',
name: '@audioPreviewName',
disabled: '@disableAudioPreview'
}
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery', 'load-image', './jquery.fileupload-process'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('blueimp-load-image/js/load-image'),
require('./jquery.fileupload-process')
);
} else {
// Browser globals:
factory(window.jQuery, window.loadImage);
}
})(function ($, loadImage) {
'use strict';

// The File Upload Audio Preview plugin extends the fileupload widget
// with audio preview functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {

options: {
// The regular expression for the types of audio files to load,
// matched against the file type:
loadAudioFileTypes: /^audio\/.*$/
},

_audioElement: document.createElement('audio'),

processActions: {
// Prepend to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.unshift(
{
action: 'loadAudio',
// Use the action as prefix for the "@" options:
prefix: true,
fileTypes: '@',
maxFileSize: '@',
disabled: '@disableAudioPreview'
},
{
action: 'setAudio',
name: '@audioPreviewName',
disabled: '@disableAudioPreview'
}
);

// Loads the audio file given via data.files and data.index
// as audio element if the browser supports playing it.
// Accepts the options fileTypes (regular expression)
// and maxFileSize (integer) to limit the files to load:
loadAudio: function (data, options) {
if (options.disabled) {
return data;
}
var file = data.files[data.index],
url,
audio;
if (this._audioElement.canPlayType &&
this._audioElement.canPlayType(file.type) &&
($.type(options.maxFileSize) !== 'number' ||
file.size <= options.maxFileSize) &&
(!options.fileTypes ||
options.fileTypes.test(file.type))) {
url = loadImage.createObjectURL(file);
if (url) {
audio = this._audioElement.cloneNode(false);
audio.src = url;
audio.controls = true;
data.audio = audio;
return data;
}
}
return data;
},
// The File Upload Audio Preview plugin extends the fileupload widget
// with audio preview functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The regular expression for the types of audio files to load,
// matched against the file type:
loadAudioFileTypes: /^audio\/.*$/
},

// Sets the audio element as a property of the file object:
setAudio: function (data, options) {
if (data.audio && !options.disabled) {
data.files[data.index][options.name || 'preview'] = data.audio;
}
return data;
}
_audioElement: document.createElement('audio'),

processActions: {
// Loads the audio file given via data.files and data.index
// as audio element if the browser supports playing it.
// Accepts the options fileTypes (regular expression)
// and maxFileSize (integer) to limit the files to load:
loadAudio: function (data, options) {
if (options.disabled) {
return data;
}
var file = data.files[data.index],
url,
audio;
if (
this._audioElement.canPlayType &&
this._audioElement.canPlayType(file.type) &&
($.type(options.maxFileSize) !== 'number' ||
file.size <= options.maxFileSize) &&
(!options.fileTypes || options.fileTypes.test(file.type))
) {
url = loadImage.createObjectURL(file);
if (url) {
audio = this._audioElement.cloneNode(false);
audio.src = url;
audio.controls = true;
data.audio = audio;
return data;
}
}
return data;
},

});

}));
// Sets the audio element as a property of the file object:
setAudio: function (data, options) {
if (data.audio && !options.disabled) {
data.files[data.index][options.name || 'preview'] = data.audio;
}
return data;
}
}
});
});
Loading

0 comments on commit 824ac19

Please sign in to comment.