Skip to content

Commit

Permalink
add: #466 option-[image, video, audio]Accept
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 committed Aug 25, 2020
1 parent ef25e60 commit 047f432
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/lib/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ export default {
options.imageUploadUrl = typeof options.imageUploadUrl === 'string' ? options.imageUploadUrl : null;
options.imageUploadSizeLimit = /\d+/.test(options.imageUploadSizeLimit) ? util.getNumber(options.imageUploadSizeLimit, 0) : null;
options.imageMultipleFile = !!options.imageMultipleFile;
options.imageAccept = typeof options.imageAccept === 'string' ? options.imageAccept.trim() || '*' : '*';
/** Image - image gallery */
options.imageGalleryUrl = typeof options.imageGalleryUrl === 'string' ? options.imageGalleryUrl : null;
/** Video */
Expand All @@ -457,6 +458,7 @@ export default {
options.videoMultipleFile = !!options.videoMultipleFile;
options.videoTagAttrs = options.videoTagAttrs || null;
options.videoIframeAttrs = options.videoIframeAttrs || null;
options.videoAccept = typeof options.videoAccept === 'string' ? options.videoAccept.trim() || '*' : '*';
/** Audio */
options.audioWidth = !options.audioWidth ? '' : util.isNumber(options.audioWidth) ? options.audioWidth + 'px' : options.audioWidth;
options.audioHeight = !options.audioHeight ? '' : util.isNumber(options.audioHeight) ? options.audioHeight + 'px' : options.audioHeight;
Expand All @@ -467,6 +469,7 @@ export default {
options.audioUploadSizeLimit = /\d+/.test(options.audioUploadSizeLimit) ? util.getNumber(options.audioUploadSizeLimit, 0) : null;
options.audioMultipleFile = !!options.audioMultipleFile;
options.audioTagAttrs = options.audioTagAttrs || null;
options.audioAccept = typeof options.audioAccept === 'string' ? options.audioAccept.trim() || '*' : '*';
/** Table */
options.tableCellControllerPosition = typeof options.tableCellControllerPosition === 'string' ? options.tableCellControllerPosition.toLowerCase() : 'cell';
/** Key actions */
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dialog/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default {
'<div class="se-dialog-form">' +
'<label>' + lang.dialogBox.audioBox.file + '</label>' +
'<div class="se-dialog-form-files">' +
'<input class="se-input-form _se_audio_files" type="file" accept="audio/*"' + (option.audioMultipleFile ? ' multiple="multiple"' : '') + '/>' +
'<input class="se-input-form _se_audio_files" type="file" accept="audio/"' + option.audioAccept + (option.audioMultipleFile ? ' multiple="multiple"' : '') + '/>' +
'<button type="button" data-command="filesRemove" class="se-btn se-dialog-files-edge-button se-file-remove" title="' + lang.controller.remove + '">' + this.icons.cancel + '</button>' +
'</div>' +
'</div>';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dialog/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default {
'<div class="se-dialog-form">' +
'<label>' + lang.dialogBox.imageBox.file + '</label>' +
'<div class="se-dialog-form-files">' +
'<input class="se-input-form _se_image_file" type="file" accept="image/*"' + (option.imageMultipleFile ? ' multiple="multiple"' : '') + '/>' +
'<input class="se-input-form _se_image_file" type="file" accept="image/"' + option.imageAccept + (option.imageMultipleFile ? ' multiple="multiple"' : '') + '/>' +
'<button type="button" class="se-btn se-dialog-files-edge-button se-file-remove" title="' + lang.controller.remove + '">' + this.icons.cancel + '</button>' +
'</div>' +
'</div>' ;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dialog/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default {
'<div class="se-dialog-form">' +
'<label>' + lang.dialogBox.videoBox.file + '</label>' +
'<div class="se-dialog-form-files">' +
'<input class="se-input-form _se_video_file" type="file" accept="video/*"' + (option.videoMultipleFile ? ' multiple="multiple"' : '') + '/>' +
'<input class="se-input-form _se_video_file" type="file" accept="video/"' + option.videoAccept + (option.videoMultipleFile ? ' multiple="multiple"' : '') + '/>' +
'<button type="button" data-command="filesRemove" class="se-btn se-dialog-files-edge-button se-file-remove" title="' + lang.controller.remove + '">' + this.icons.cancel + '</button>' +
'</div>' +
'</div>' ;
Expand Down

0 comments on commit 047f432

Please sign in to comment.