Add Title to attachment box (#4702)

resolve: #4692
This commit is contained in:
windingwind 2024-09-23 10:31:19 +02:00 committed by GitHub
parent b946946b00
commit d4b2fbf33b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -37,6 +37,10 @@
ondragstart="let dt = event.dataTransfer; dt.setData('text/x-moz-url', this.value); dt.setData('text/uri-list', this.value); dt.setData('text/plain', this.value);"/>
</html:div>
<html:div class="metadata-table">
<html:div id="titleRow" class="meta-row">
<html:div class="meta-label"><html:label id="title-label" class="key" data-l10n-id="attachment-info-title"/></html:div>
<html:div class="meta-data"><editable-text id="title" aria-labelledby="title-label" tight="true"/></html:div>
</html:div>
<html:div id="fileNameRow" class="meta-row">
<html:div class="meta-label"><html:label id="fileName-label" class="key" data-l10n-id="attachment-info-filename"/></html:div>
<html:div class="meta-data"><editable-text id="fileName" aria-labelledby="fileName-label" tight="true"/></html:div>
@ -243,6 +247,11 @@
this._id('url-menu').openPopupAtScreen(event.screenX, event.screenY, true);
});
this._id("title").addEventListener('blur', () => {
this.item.setField('title', this._id('title').value);
this.item.saveTx();
});
let fileName = this._id("fileName");
fileName.addEventListener('focus', () => {
this._isEditingFilename = true;
@ -403,6 +412,8 @@
else {
accessed.hidden = true;
}
this._id("title").value = this.item.getField('title');
if (this.displayFileName && !isLinkedURL) {
let fileName = "";

View file

@ -527,6 +527,7 @@ new-collection-dialog =
new-collection-name = Name:
new-collection-create-in = Create in:
attachment-info-title = Title
attachment-info-filename = Filename
attachment-info-accessed = Accessed
attachment-info-pages = Pages