Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsboogaard-luminis committed Apr 23, 2020
1 parent 998e3dc commit 230a1f1
Show file tree
Hide file tree
Showing 8 changed files with 1,496 additions and 3,176 deletions.
2 changes: 1 addition & 1 deletion dist/filepond-plugin-media-preview.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* FilePondPluginmediaPreview 1.0.4
* FilePondPluginmediaPreview 1.0.5
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit undefined for details.
*/
Expand Down
34 changes: 17 additions & 17 deletions dist/filepond-plugin-media-preview.esm.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*!
* FilePondPluginMediaPreview 1.0.4
* FilePondPluginMediaPreview 1.0.5
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit undefined for details.
*/

/* eslint-disable */

const isPreviewableVideo = file => /^video/.test(file.type);
const isPreviewableVideo = (file) => /^video/.test(file.type);

const isPreviewableAudio = file => /^audio/.test(file.type);
const isPreviewableAudio = (file) => /^audio/.test(file.type);

('use strict');

Expand Down Expand Up @@ -126,7 +126,7 @@ class AudioPlayer {
}
}

const createMediaView = _ =>
const createMediaView = (_) =>
_.utils.createView({
name: 'media-preview',
tag: 'div',
Expand Down Expand Up @@ -195,16 +195,16 @@ const createMediaView = _ =>

root.dispatch('DID_UPDATE_PANEL_HEIGHT', {
id: props.id,
height: height
height: height,
});
},
false
);
}
})
},
}),
});

const createMediaWrapperView = _ => {
const createMediaWrapperView = (_) => {
/**
* Write handler for when preview container has been created
*/
Expand All @@ -215,7 +215,7 @@ const createMediaWrapperView = _ => {

// the preview is now ready to be drawn
root.dispatch('DID_MEDIA_PREVIEW_LOAD', {
id
id,
});
};

Expand All @@ -228,7 +228,7 @@ const createMediaWrapperView = _ => {
// append media presenter
root.ref.media = root.appendChildView(
root.createChildView(media, {
id: props.id
id: props.id,
})
);
};
Expand All @@ -238,21 +238,21 @@ const createMediaWrapperView = _ => {
create,
write: _.utils.createRoute({
// media preview stated
DID_MEDIA_PREVIEW_CONTAINER_CREATE: didCreatePreviewContainer
})
DID_MEDIA_PREVIEW_CONTAINER_CREATE: didCreatePreviewContainer,
}),
});
};

/**
* Media Preview Plugin
*/
const plugin = fpAPI => {
const plugin = (fpAPI) => {
const { addFilter, utils } = fpAPI;
const { Type, createRoute } = utils;
const mediaWrapperView = createMediaWrapperView(fpAPI);

// called for each view that is created right after the 'create' method
addFilter('CREATE_VIEW', viewAPI => {
addFilter('CREATE_VIEW', (viewAPI) => {
// get reference to created view
const { is, view, query } = viewAPI;

Expand Down Expand Up @@ -287,7 +287,7 @@ const plugin = fpAPI => {
view.registerWriter(
createRoute(
{
DID_LOAD_ITEM: didLoadItem
DID_LOAD_ITEM: didLoadItem,
},
({ root, props }) => {
const { id } = props;
Expand All @@ -309,8 +309,8 @@ const plugin = fpAPI => {
return {
options: {
allowVideoPreview: [true, Type.BOOLEAN],
allowAudioPreview: [true, Type.BOOLEAN]
}
allowAudioPreview: [true, Type.BOOLEAN],
},
};
};

Expand Down
4 changes: 2 additions & 2 deletions dist/filepond-plugin-media-preview.esm.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions dist/filepond-plugin-media-preview.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*!
* FilePondPluginMediaPreview 1.0.4
* FilePondPluginMediaPreview 1.0.5
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit undefined for details.
*/

/* eslint-disable */

(function(global, factory) {
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory())
: typeof define === 'function' && define.amd
? define(factory)
: ((global = global || self),
(global.FilePondPluginMediaPreview = factory()));
})(this, function() {
})(this, function () {
'use strict';

const isPreviewableVideo = file => /^video/.test(file.type);
const isPreviewableVideo = (file) => /^video/.test(file.type);

const isPreviewableAudio = file => /^audio/.test(file.type);
const isPreviewableAudio = (file) => /^audio/.test(file.type);

('use strict');

Expand Down Expand Up @@ -143,7 +143,7 @@
}
}

const createMediaView = _ =>
const createMediaView = (_) =>
_.utils.createView({
name: 'media-preview',
tag: 'div',
Expand All @@ -152,7 +152,7 @@
const { id } = props; // get item

const item = root.query('GET_ITEM', {
id: props.id
id: props.id,
});
let tagName = isPreviewableAudio(item.file) ? 'audio' : 'video';
root.ref.media = document.createElement(tagName);
Expand Down Expand Up @@ -182,12 +182,12 @@
const { id } = props; // get item

const item = root.query('GET_ITEM', {
id: props.id
id: props.id,
});
if (!item) return;
let URL = window.URL || window.webkitURL;
let blob = new Blob([item.file], {
type: item.file.type
type: item.file.type,
});
root.ref.media.type = item.file.type;
root.ref.media.src = URL.createObjectURL(blob); // create audio player in case of audio file
Expand All @@ -209,16 +209,16 @@

root.dispatch('DID_UPDATE_PANEL_HEIGHT', {
id: props.id,
height: height
height: height,
});
},
false
);
}
})
},
}),
});

const createMediaWrapperView = _ => {
const createMediaWrapperView = (_) => {
/**
* Write handler for when preview container has been created
*/
Expand All @@ -228,7 +228,7 @@
if (!item) return; // the preview is now ready to be drawn

root.dispatch('DID_MEDIA_PREVIEW_LOAD', {
id
id,
});
};
/**
Expand All @@ -240,7 +240,7 @@

root.ref.media = root.appendChildView(
root.createChildView(media, {
id: props.id
id: props.id,
})
);
};
Expand All @@ -250,21 +250,21 @@
create,
write: _.utils.createRoute({
// media preview stated
DID_MEDIA_PREVIEW_CONTAINER_CREATE: didCreatePreviewContainer
})
DID_MEDIA_PREVIEW_CONTAINER_CREATE: didCreatePreviewContainer,
}),
});
};

/**
* Media Preview Plugin
*/

const plugin = fpAPI => {
const plugin = (fpAPI) => {
const { addFilter, utils } = fpAPI;
const { Type, createRoute } = utils;
const mediaWrapperView = createMediaWrapperView(fpAPI); // called for each view that is created right after the 'create' method

addFilter('CREATE_VIEW', viewAPI => {
addFilter('CREATE_VIEW', (viewAPI) => {
// get reference to created view
const { is, view, query } = viewAPI; // only hook up to item view

Expand All @@ -286,19 +286,19 @@

root.ref.mediaPreview = view.appendChildView(
view.createChildView(mediaWrapperView, {
id
id,
})
); // now ready

root.dispatch('DID_MEDIA_PREVIEW_CONTAINER_CREATE', {
id
id,
});
}; // start writing

view.registerWriter(
createRoute(
{
DID_LOAD_ITEM: didLoadItem
DID_LOAD_ITEM: didLoadItem,
},
({ root, props }) => {
const { id } = props;
Expand All @@ -318,8 +318,8 @@
return {
options: {
allowVideoPreview: [true, Type.BOOLEAN],
allowAudioPreview: [true, Type.BOOLEAN]
}
allowAudioPreview: [true, Type.BOOLEAN],
},
};
}; // fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags

Expand All @@ -329,7 +329,7 @@
if (isBrowser) {
document.dispatchEvent(
new CustomEvent('FilePond:pluginloaded', {
detail: plugin
detail: plugin,
})
);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/filepond-plugin-media-preview.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 230a1f1

Please sign in to comment.