|
|
|
@ -11,6 +11,9 @@
|
|
|
|
|
<form class="form" novalidate method="post" onsubmit={ (event) => ( state.validator.submit(event) ) }>
|
|
|
|
|
<div class="sidebar__body">
|
|
|
|
|
|
|
|
|
|
<input type="hidden" if={ state.current._id } name="_id" value="{ state.current._id }" />
|
|
|
|
|
<input type="hidden" if={ state.current._rev } name="_rev" value="{ state.current._rev }" />
|
|
|
|
|
|
|
|
|
|
<!-- name -->
|
|
|
|
|
<div class="field-group">
|
|
|
|
|
<label class="field-label">
|
|
|
|
@ -49,7 +52,7 @@
|
|
|
|
|
<div class="field-group">
|
|
|
|
|
<label class="field-label">
|
|
|
|
|
description
|
|
|
|
|
<textarea class="field-text" name="description">{ state.current.description ? state.current.description : '' }</textarea>
|
|
|
|
|
<textarea class="field-text" name="description" value="{ state.current.description ? state.current.description : '' }"></textarea>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -171,6 +174,8 @@
|
|
|
|
|
// receive from extensions database
|
|
|
|
|
Neutralino.events.on('pouchdb.apps.readyOne', (event) => {
|
|
|
|
|
|
|
|
|
|
this.reset()
|
|
|
|
|
|
|
|
|
|
this.state.current = event.detail
|
|
|
|
|
tagsStore.trigger('update', this.state.current.tags)
|
|
|
|
|
|
|
|
|
@ -227,7 +232,11 @@
|
|
|
|
|
data.thumbnail = this.state.current.thumbnail
|
|
|
|
|
|
|
|
|
|
// send to extensions database
|
|
|
|
|
if (data._id) {
|
|
|
|
|
Neutralino.extensions.dispatch('js.neutralino.pouchdb', 'pouchdb.apps.create', data)
|
|
|
|
|
} else {
|
|
|
|
|
Neutralino.extensions.dispatch('js.neutralino.pouchdb', 'pouchdb.apps.update', data)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -236,7 +245,7 @@
|
|
|
|
|
* @param object event
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
async handleSelectMedia(event)
|
|
|
|
|
async handleSelectThumbnail(event)
|
|
|
|
|
{
|
|
|
|
|
const entry = await Neutralino.os.showOpenDialog('', {
|
|
|
|
|
'multiSelections': false,
|
|
|
|
@ -251,7 +260,7 @@
|
|
|
|
|
const data = await Neutralino.filesystem.readBinaryFile(entry[0])
|
|
|
|
|
|
|
|
|
|
// adding as blob
|
|
|
|
|
this.state.current.media = _arrayBufferToBase64(data)
|
|
|
|
|
this.state.current.thumbnail = _arrayBufferToBase64(data)
|
|
|
|
|
|
|
|
|
|
this.update()
|
|
|
|
|
},
|
|
|
|
|