2021-11-30 11:21:34 +03:00
|
|
|
<KoenigCard
|
|
|
|
@env={{@env}}
|
2021-12-10 21:17:11 +03:00
|
|
|
@class={{"ba b--transparent relative kg-card-hover kg-card kg-upload-card mih10 miw-100 relative" (kg-style "breakout" size=@payload.cardWidth)}}
|
2021-11-30 11:21:34 +03:00
|
|
|
@headerOffset={{@headerOffset}}
|
|
|
|
@toolbar={{this.toolbar}}
|
|
|
|
@payload={{@payload}}
|
|
|
|
@isSelected={{@isSelected}}
|
|
|
|
@isEditing={{@isEditing}}
|
|
|
|
@selectCard={{@selectCard}}
|
|
|
|
@deselectCard={{@deselectCard}}
|
|
|
|
@editCard={{@editCard}}
|
|
|
|
@hasEditMode={{not this.isEmpty}}
|
|
|
|
@saveCard={{@saveCard}}
|
|
|
|
@saveAsSnippet={{@saveAsSnippet}}
|
|
|
|
@addParagraphAfterCard={{@addParagraphAfterCard}}
|
|
|
|
@moveCursorToPrevSection={{@moveCursorToPrevSection}}
|
|
|
|
@moveCursorToNextSection={{@moveCursorToNextSection}}
|
|
|
|
@editor={{@editor}}
|
|
|
|
{{did-insert this.didInsert}}
|
|
|
|
{{on "dragover" this.dragOver}}
|
|
|
|
{{on "dragleave" this.dragLeave}}
|
|
|
|
{{on "drop" this.drop}}
|
|
|
|
as |card|
|
|
|
|
>
|
2021-12-08 18:34:25 +03:00
|
|
|
{{#if @payload.src}}
|
2021-12-10 21:17:11 +03:00
|
|
|
<div class="kg-upload-container">
|
2021-12-08 18:34:25 +03:00
|
|
|
<div class="kg-media-container">
|
2021-12-01 12:04:32 +03:00
|
|
|
<GhUploader
|
|
|
|
@uploadUrl="/media/thumbnail/upload/"
|
|
|
|
@resourceName="media"
|
2021-12-08 21:38:23 +03:00
|
|
|
@files={{this.thumbnailFiles}}
|
2021-12-01 12:04:32 +03:00
|
|
|
@requestMethod="put"
|
|
|
|
@accept={{this.imageMimeTypes}}
|
|
|
|
@extensions={{this.imageExtensions}}
|
|
|
|
@onComplete={{this.audioThumbnailUploadCompleted}}
|
|
|
|
@onFailed={{this.audioThumbnailUploadFailed}}
|
|
|
|
@paramsHash={{hash url=@payload.src}}
|
|
|
|
as |uploader|
|
|
|
|
>
|
2021-11-30 11:21:34 +03:00
|
|
|
|
2021-12-08 18:34:25 +03:00
|
|
|
{{#if (or uploader.errors uploader.isUploading)}}
|
|
|
|
{{#if uploader.errors}}
|
2021-12-13 14:36:38 +03:00
|
|
|
<span class="db flex items-center h8 pl2 pr2 red sans-serif f6 fw6">
|
2021-12-08 18:34:25 +03:00
|
|
|
{{uploader.errors.firstObject.message}}
|
|
|
|
</span>
|
|
|
|
{{/if}}
|
2021-11-30 11:21:34 +03:00
|
|
|
|
2021-12-08 18:34:25 +03:00
|
|
|
{{#if this.isDraggedOver}}
|
|
|
|
<span class="fw6 f7 white lh-1">
|
|
|
|
Drop it 🔥
|
|
|
|
</span>
|
|
|
|
{{else if uploader.isUploading}}
|
|
|
|
{{uploader.progressBar}}
|
|
|
|
{{else if (not @payload.thumbnailSrc)}}
|
2021-12-10 21:17:11 +03:00
|
|
|
<button class="kg-upload-button" {{on "click" this.triggerThumbnailFileDialog}}>
|
2021-12-08 18:34:25 +03:00
|
|
|
{{svg-jar "audio-upload"}}
|
|
|
|
</button>
|
2021-12-01 12:04:32 +03:00
|
|
|
{{else}}
|
2021-12-10 21:17:11 +03:00
|
|
|
<button class="kg-upload-button" {{on "click" this.triggerThumbnailFileDialog}}>
|
2021-12-08 18:34:25 +03:00
|
|
|
<img src={{@payload.thumbnailSrc}} class="{{kg-style this.kgImgStyle}}">
|
|
|
|
</button>
|
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
|
|
|
{{#if this.isDraggedOver}}
|
|
|
|
<span class="fw6 f7 white lh-1">
|
|
|
|
Drop it 🔥
|
|
|
|
</span>
|
|
|
|
{{else if uploader.isUploading}}
|
|
|
|
{{uploader.progressBar}}
|
|
|
|
{{else if @payload.thumbnailSrc}}
|
2021-12-10 21:17:11 +03:00
|
|
|
<div class="kg-upload-button">
|
2021-12-08 18:34:25 +03:00
|
|
|
<img src={{@payload.thumbnailSrc}} />
|
|
|
|
<div class="image-overlay">
|
|
|
|
<div class="flex flex-row-reverse">
|
2021-12-13 13:40:29 +03:00
|
|
|
<button class="bg-white-90 br3 pe-auto" {{on "click" this.deleteThumbnail}}>
|
2021-12-14 11:37:39 +03:00
|
|
|
{{svg-jar "koenig/kg-trash" class="kg-replace-icon fill-darkgrey"}}
|
2021-12-08 18:34:25 +03:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-12-01 12:04:32 +03:00
|
|
|
</div>
|
2021-12-08 18:34:25 +03:00
|
|
|
{{else}}
|
2021-12-13 21:08:55 +03:00
|
|
|
{{#if @isEditing}}
|
|
|
|
<button class="kg-upload-button pointer" {{on "click" this.triggerThumbnailFileDialog}}>
|
|
|
|
{{svg-jar "upload" class="kg-audio-upload-icon"}}
|
|
|
|
</button>
|
|
|
|
{{else}}
|
|
|
|
<button class="kg-upload-button">
|
|
|
|
{{svg-jar "audio-file" class="kg-audio-icon"}}
|
|
|
|
</button>
|
|
|
|
{{/if}}
|
2021-12-01 12:04:32 +03:00
|
|
|
{{/if}}
|
2021-12-08 18:34:25 +03:00
|
|
|
{{/if}}
|
2021-12-01 12:04:32 +03:00
|
|
|
<div style="display:none">
|
2021-12-06 21:50:21 +03:00
|
|
|
<GhFileInput
|
|
|
|
@multiple={{false}}
|
|
|
|
@action={{uploader.setFiles}}
|
|
|
|
@accept={{this.imageMimeTypes}}
|
|
|
|
@onInsert={{uploader.registerFileInput}}
|
|
|
|
/>
|
2021-12-01 12:04:32 +03:00
|
|
|
</div>
|
|
|
|
</GhUploader>
|
2021-12-08 18:34:25 +03:00
|
|
|
</div>
|
2021-12-01 12:04:32 +03:00
|
|
|
|
2021-12-08 18:34:25 +03:00
|
|
|
<div class="kg-player-container">
|
|
|
|
<GhTextInput
|
2021-12-09 22:51:53 +03:00
|
|
|
@value={{@payload.title}}
|
2021-12-08 18:34:25 +03:00
|
|
|
@input={{action "setAudioTitle" value="target.value"}}
|
2021-12-10 21:17:11 +03:00
|
|
|
@class="kg-upload-title"
|
2021-12-08 18:34:25 +03:00
|
|
|
/>
|
|
|
|
<div class="kg-player">
|
2021-12-14 13:49:33 +03:00
|
|
|
<button class="kg-player-play-icon">{{svg-jar "play"}}</button>
|
|
|
|
<span class="kg-player-current-time">0:00</span>
|
|
|
|
<div class="kg-player-time">
|
|
|
|
/<span class="kg-player-duration">{{this.totalDuration}}</span>
|
2021-12-07 22:13:23 +03:00
|
|
|
</div>
|
2021-12-14 13:49:33 +03:00
|
|
|
<input type="range" class="kg-player-seek-slider" max="100" value="0">
|
|
|
|
<button class="kg-player-playback-rate">1×</button>
|
|
|
|
<button class="kg-player-unmute-icon">{{svg-jar "unmute"}}</button>
|
|
|
|
<input type="range" class="kg-player-volume-slider" max="100" value="70">
|
2021-12-07 22:13:23 +03:00
|
|
|
</div>
|
2021-12-01 12:04:32 +03:00
|
|
|
</div>
|
2021-12-08 18:34:25 +03:00
|
|
|
</div>
|
2021-12-13 13:28:12 +03:00
|
|
|
{{#if (not @isEditing)}}
|
|
|
|
<div class="koenig-card-click-overlay"></div>
|
|
|
|
{{/if}}
|
2021-12-08 18:34:25 +03:00
|
|
|
{{else}}
|
2021-12-10 21:17:11 +03:00
|
|
|
<div class="kg-upload-container kg-upload-container-empty">
|
2021-12-08 18:34:25 +03:00
|
|
|
<GhUploader
|
|
|
|
@uploadUrl="/media/upload/"
|
|
|
|
@resourceName="media"
|
|
|
|
@files={{this.files}}
|
|
|
|
@accept={{this.audioMimeTypes}}
|
|
|
|
@extensions={{this.audioExtensions}}
|
|
|
|
@onStart={{this.audioUploadStarted}}
|
|
|
|
@onComplete={{this.audioUploadCompleted}}
|
|
|
|
@onFailed={{this.audioUploadFailed}}
|
|
|
|
as |uploader|
|
|
|
|
>
|
|
|
|
{{#if (or uploader.errors uploader.isUploading)}}
|
|
|
|
{{#if uploader.errors}}
|
2021-12-13 14:36:38 +03:00
|
|
|
<span class="flex items-center h8 pl2 pr2 red sans-serif f6 fw5">
|
2021-12-08 18:34:25 +03:00
|
|
|
{{uploader.errors.firstObject.message}}
|
|
|
|
</span>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if this.isDraggedOver}}
|
|
|
|
<span class="db center sans-serif fw7 f7 middarkgrey">
|
|
|
|
Drop it like it's hot 🔥
|
|
|
|
</span>
|
|
|
|
{{else if uploader.isUploading}}
|
|
|
|
{{uploader.progressBar}}
|
|
|
|
{{/if}}
|
2021-12-08 21:38:23 +03:00
|
|
|
{{else}}
|
2021-12-08 18:34:25 +03:00
|
|
|
{{#if this.isDraggedOver}}
|
|
|
|
<span class="db center sans-serif fw7 f7 middarkgrey">
|
|
|
|
Drop it like it's hot 🔥
|
|
|
|
</span>
|
|
|
|
{{else if uploader.isUploading}}
|
|
|
|
{{uploader.progressBar}}
|
|
|
|
{{else}}
|
2021-12-13 18:18:32 +03:00
|
|
|
<div {{on "click" this.triggerAudioFileDialog}} class="flex pa4 pointer">
|
2021-12-09 19:22:51 +03:00
|
|
|
{{svg-jar "audio-upload"}}
|
2021-12-10 21:17:11 +03:00
|
|
|
<span class="kg-upload-placeholder-text">
|
2021-12-08 18:34:25 +03:00
|
|
|
Click to upload an audio file
|
|
|
|
</span>
|
2021-12-09 19:22:51 +03:00
|
|
|
</div>
|
2021-12-08 18:34:25 +03:00
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
<div style="display:none">
|
|
|
|
<GhFileInput
|
|
|
|
@multiple={{false}}
|
|
|
|
@action={{uploader.setFiles}}
|
|
|
|
@accept={{this.audioMimeTypes}}
|
|
|
|
@onInsert={{uploader.registerFileInput}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</GhUploader>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2021-11-30 11:21:34 +03:00
|
|
|
</KoenigCard>
|