2016-06-06 20:57:22 +02:00
|
|
|
'use strict';
|
|
|
|
|
2016-07-03 13:46:49 +02:00
|
|
|
const api = require('../api.js');
|
2016-06-17 20:25:44 +02:00
|
|
|
const events = require('../events.js');
|
2016-07-03 13:46:49 +02:00
|
|
|
const misc = require('../util/misc.js');
|
2016-06-06 20:57:22 +02:00
|
|
|
const views = require('../util/views.js');
|
2017-08-25 23:53:51 +02:00
|
|
|
const Note = require('../models/note.js');
|
|
|
|
const Point = require('../models/point.js');
|
2016-07-03 13:46:49 +02:00
|
|
|
const TagInputControl = require('./tag_input_control.js');
|
2016-08-01 20:07:49 +02:00
|
|
|
const ExpanderControl = require('../controls/expander_control.js');
|
2016-07-27 22:27:33 +02:00
|
|
|
const FileDropperControl = require('../controls/file_dropper_control.js');
|
2016-06-06 20:57:22 +02:00
|
|
|
|
2016-06-17 20:25:44 +02:00
|
|
|
const template = views.getTemplate('post-edit-sidebar');
|
|
|
|
|
|
|
|
class PostEditSidebarControl extends events.EventTarget {
|
2016-07-22 13:27:52 +02:00
|
|
|
constructor(hostNode, post, postContentControl, postNotesOverlayControl) {
|
2016-06-17 20:25:44 +02:00
|
|
|
super();
|
2016-06-06 20:57:22 +02:00
|
|
|
this._hostNode = hostNode;
|
|
|
|
this._post = post;
|
|
|
|
this._postContentControl = postContentControl;
|
2016-07-22 13:27:52 +02:00
|
|
|
this._postNotesOverlayControl = postNotesOverlayControl;
|
2016-07-27 22:27:33 +02:00
|
|
|
this._newPostContent = null;
|
2016-06-06 20:57:22 +02:00
|
|
|
|
2016-07-22 13:27:52 +02:00
|
|
|
this._postNotesOverlayControl.switchToPassiveEdit();
|
|
|
|
|
2016-06-17 20:25:44 +02:00
|
|
|
views.replaceContent(this._hostNode, template({
|
2016-06-06 20:57:22 +02:00
|
|
|
post: this._post,
|
2018-06-25 16:47:20 +02:00
|
|
|
enableSafety: api.safetyEnabled(),
|
2017-08-25 23:53:51 +02:00
|
|
|
hasClipboard: document.queryCommandSupported('copy'),
|
2016-07-03 13:46:49 +02:00
|
|
|
canEditPostSafety: api.hasPrivilege('posts:edit:safety'),
|
|
|
|
canEditPostSource: api.hasPrivilege('posts:edit:source'),
|
|
|
|
canEditPostTags: api.hasPrivilege('posts:edit:tags'),
|
2016-07-28 19:28:48 +02:00
|
|
|
canEditPostRelations: api.hasPrivilege('posts:edit:relations'),
|
2016-08-27 22:14:17 +02:00
|
|
|
canEditPostNotes: api.hasPrivilege('posts:edit:notes') &&
|
2016-08-31 22:20:21 +02:00
|
|
|
post.type !== 'video' &&
|
|
|
|
post.type !== 'flash',
|
2016-07-28 19:28:48 +02:00
|
|
|
canEditPostFlags: api.hasPrivilege('posts:edit:flags'),
|
|
|
|
canEditPostContent: api.hasPrivilege('posts:edit:content'),
|
2016-07-03 13:46:49 +02:00
|
|
|
canEditPostThumbnail: api.hasPrivilege('posts:edit:thumbnail'),
|
2018-12-27 10:22:36 +01:00
|
|
|
canEditPostSource : api.hasPrivilege('posts:edit:source'),
|
2016-07-03 13:46:49 +02:00
|
|
|
canCreateAnonymousPosts: api.hasPrivilege('posts:create:anonymous'),
|
|
|
|
canDeletePosts: api.hasPrivilege('posts:delete'),
|
|
|
|
canFeaturePosts: api.hasPrivilege('posts:feature'),
|
2016-10-22 10:03:38 +02:00
|
|
|
canMergePosts: api.hasPrivilege('posts:merge'),
|
2016-06-17 20:25:44 +02:00
|
|
|
}));
|
2016-07-03 13:46:49 +02:00
|
|
|
|
2016-08-01 20:07:49 +02:00
|
|
|
new ExpanderControl(
|
2016-08-23 23:09:07 +02:00
|
|
|
'post-info',
|
2016-08-01 20:07:49 +02:00
|
|
|
'Basic info',
|
2018-12-27 10:22:36 +01:00
|
|
|
this._hostNode.querySelectorAll('.safety, .relations, .flags, .post-source'));
|
2016-08-23 23:09:07 +02:00
|
|
|
this._tagsExpander = new ExpanderControl(
|
|
|
|
'post-tags',
|
|
|
|
`Tags (${this._post.tags.length})`,
|
2016-08-01 20:07:49 +02:00
|
|
|
this._hostNode.querySelectorAll('.tags'));
|
2016-08-23 23:09:07 +02:00
|
|
|
this._notesExpander = new ExpanderControl(
|
|
|
|
'post-notes',
|
2016-07-22 13:27:52 +02:00
|
|
|
'Notes',
|
|
|
|
this._hostNode.querySelectorAll('.notes'));
|
2016-08-01 20:07:49 +02:00
|
|
|
new ExpanderControl(
|
2016-08-23 23:09:07 +02:00
|
|
|
'post-content',
|
2016-08-01 20:07:49 +02:00
|
|
|
'Content',
|
|
|
|
this._hostNode.querySelectorAll('.post-content, .post-thumbnail'));
|
2016-08-02 10:37:56 +02:00
|
|
|
new ExpanderControl(
|
2016-08-23 23:09:07 +02:00
|
|
|
'post-management',
|
2016-08-02 10:37:56 +02:00
|
|
|
'Management',
|
|
|
|
this._hostNode.querySelectorAll('.management'));
|
2016-08-01 20:07:49 +02:00
|
|
|
|
2016-08-23 23:09:07 +02:00
|
|
|
this._syncExpanderTitles();
|
|
|
|
|
2016-07-03 13:46:49 +02:00
|
|
|
if (this._formNode) {
|
|
|
|
this._formNode.addEventListener('submit', e => this._evtSubmit(e));
|
|
|
|
}
|
|
|
|
|
2016-07-26 19:58:26 +02:00
|
|
|
if (this._tagInputNode) {
|
2017-10-01 21:46:53 +02:00
|
|
|
this._tagControl = new TagInputControl(
|
|
|
|
this._tagInputNode, post.tags);
|
2016-07-26 19:58:26 +02:00
|
|
|
}
|
2016-07-27 22:27:33 +02:00
|
|
|
|
|
|
|
if (this._contentInputNode) {
|
|
|
|
this._contentFileDropper = new FileDropperControl(
|
2017-02-21 19:09:18 +01:00
|
|
|
this._contentInputNode, {
|
|
|
|
allowUrls: true,
|
|
|
|
lock: true,
|
|
|
|
urlPlaceholder: '...or paste an URL here.'});
|
2016-08-20 22:30:08 +02:00
|
|
|
this._contentFileDropper.addEventListener('fileadd', e => {
|
|
|
|
this._newPostContent = e.detail.files[0];
|
|
|
|
});
|
2017-02-21 18:30:19 +01:00
|
|
|
this._contentFileDropper.addEventListener('urladd', e => {
|
|
|
|
this._newPostContent = e.detail.urls[0];
|
|
|
|
});
|
2016-07-27 22:27:33 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 19:28:48 +02:00
|
|
|
if (this._thumbnailInputNode) {
|
|
|
|
this._thumbnailFileDropper = new FileDropperControl(
|
2016-08-20 22:30:08 +02:00
|
|
|
this._thumbnailInputNode, {lock: true});
|
|
|
|
this._thumbnailFileDropper.addEventListener('fileadd', e => {
|
|
|
|
this._newPostThumbnail = e.detail.files[0];
|
|
|
|
this._thumbnailRemovalLinkNode.style.display = 'block';
|
|
|
|
});
|
2016-07-28 19:28:48 +02:00
|
|
|
}
|
|
|
|
|
2016-07-31 23:54:29 +02:00
|
|
|
if (this._thumbnailRemovalLinkNode) {
|
|
|
|
this._thumbnailRemovalLinkNode.addEventListener(
|
|
|
|
'click', e => this._evtRemoveThumbnailClick(e));
|
|
|
|
this._thumbnailRemovalLinkNode.style.display =
|
|
|
|
this._post.hasCustomThumbnail ? 'block' : 'none';
|
|
|
|
}
|
|
|
|
|
2016-07-22 13:27:52 +02:00
|
|
|
if (this._addNoteLinkNode) {
|
|
|
|
this._addNoteLinkNode.addEventListener(
|
|
|
|
'click', e => this._evtAddNoteClick(e));
|
|
|
|
}
|
|
|
|
|
2017-08-25 23:53:51 +02:00
|
|
|
if (this._copyNotesLinkNode) {
|
|
|
|
this._copyNotesLinkNode.addEventListener(
|
|
|
|
'click', e => this._evtCopyNotesClick(e));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this._pasteNotesLinkNode) {
|
|
|
|
this._pasteNotesLinkNode.addEventListener(
|
|
|
|
'click', e => this._evtPasteNotesClick(e));
|
|
|
|
}
|
|
|
|
|
2016-07-22 13:27:52 +02:00
|
|
|
if (this._deleteNoteLinkNode) {
|
|
|
|
this._deleteNoteLinkNode.addEventListener(
|
|
|
|
'click', e => this._evtDeleteNoteClick(e));
|
|
|
|
}
|
|
|
|
|
2016-08-02 10:37:56 +02:00
|
|
|
if (this._featureLinkNode) {
|
|
|
|
this._featureLinkNode.addEventListener(
|
|
|
|
'click', e => this._evtFeatureClick(e));
|
|
|
|
}
|
|
|
|
|
2016-10-22 10:03:38 +02:00
|
|
|
if (this._mergeLinkNode) {
|
|
|
|
this._mergeLinkNode.addEventListener(
|
|
|
|
'click', e => this._evtMergeClick(e));
|
|
|
|
}
|
|
|
|
|
2016-08-02 11:05:40 +02:00
|
|
|
if (this._deleteLinkNode) {
|
|
|
|
this._deleteLinkNode.addEventListener(
|
|
|
|
'click', e => this._evtDeleteClick(e));
|
|
|
|
}
|
|
|
|
|
2016-07-22 13:27:52 +02:00
|
|
|
this._postNotesOverlayControl.addEventListener(
|
|
|
|
'blur', e => this._evtNoteBlur(e));
|
|
|
|
|
|
|
|
this._postNotesOverlayControl.addEventListener(
|
|
|
|
'focus', e => this._evtNoteFocus(e));
|
|
|
|
|
2016-07-27 22:27:33 +02:00
|
|
|
this._post.addEventListener(
|
|
|
|
'changeContent', e => this._evtPostContentChange(e));
|
2016-07-28 19:28:48 +02:00
|
|
|
|
|
|
|
this._post.addEventListener(
|
|
|
|
'changeThumbnail', e => this._evtPostThumbnailChange(e));
|
2016-07-30 16:32:50 +02:00
|
|
|
|
|
|
|
if (this._formNode) {
|
|
|
|
const inputNodes = this._formNode.querySelectorAll(
|
|
|
|
'input, textarea');
|
|
|
|
for (let node of inputNodes) {
|
|
|
|
node.addEventListener(
|
2016-08-23 23:09:07 +02:00
|
|
|
'change',
|
|
|
|
e => this.dispatchEvent(new CustomEvent('change')));
|
2016-07-30 16:32:50 +02:00
|
|
|
}
|
2016-08-05 22:29:12 +02:00
|
|
|
this._postNotesOverlayControl.addEventListener(
|
2016-08-23 23:09:07 +02:00
|
|
|
'change',
|
|
|
|
e => this.dispatchEvent(new CustomEvent('change')));
|
2016-07-30 16:32:50 +02:00
|
|
|
}
|
2016-07-22 13:27:52 +02:00
|
|
|
|
2016-08-23 23:09:07 +02:00
|
|
|
for (let eventType of ['add', 'remove']) {
|
|
|
|
this._post.notes.addEventListener(eventType, e => {
|
|
|
|
this._syncExpanderTitles();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-10-01 21:46:53 +02:00
|
|
|
this._tagControl.addEventListener(
|
|
|
|
'change', e => {
|
|
|
|
this.dispatchEvent(new CustomEvent('change'));
|
|
|
|
this._syncExpanderTitles();
|
|
|
|
});
|
2016-08-23 23:09:07 +02:00
|
|
|
|
2016-07-22 13:27:52 +02:00
|
|
|
if (this._noteTextareaNode) {
|
|
|
|
this._noteTextareaNode.addEventListener(
|
|
|
|
'change', e => this._evtNoteTextChangeRequest(e));
|
|
|
|
}
|
2016-07-27 22:27:33 +02:00
|
|
|
}
|
|
|
|
|
2016-08-23 23:09:07 +02:00
|
|
|
_syncExpanderTitles() {
|
|
|
|
this._notesExpander.title = `Notes (${this._post.notes.length})`;
|
|
|
|
this._tagsExpander.title = `Tags (${this._post.tags.length})`;
|
|
|
|
}
|
|
|
|
|
2016-07-27 22:27:33 +02:00
|
|
|
_evtPostContentChange(e) {
|
|
|
|
this._contentFileDropper.reset();
|
2016-07-03 13:46:49 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 19:28:48 +02:00
|
|
|
_evtPostThumbnailChange(e) {
|
|
|
|
this._thumbnailFileDropper.reset();
|
|
|
|
}
|
|
|
|
|
2016-07-31 23:54:29 +02:00
|
|
|
_evtRemoveThumbnailClick(e) {
|
2016-08-22 01:25:10 +02:00
|
|
|
e.preventDefault();
|
2016-07-31 23:54:29 +02:00
|
|
|
this._thumbnailFileDropper.reset();
|
|
|
|
this._newPostThumbnail = null;
|
|
|
|
this._thumbnailRemovalLinkNode.style.display = 'none';
|
|
|
|
}
|
|
|
|
|
2016-08-02 10:37:56 +02:00
|
|
|
_evtFeatureClick(e) {
|
2016-08-22 01:25:10 +02:00
|
|
|
e.preventDefault();
|
2016-08-02 10:37:56 +02:00
|
|
|
if (confirm('Are you sure you want to feature this post?')) {
|
|
|
|
this.dispatchEvent(new CustomEvent('feature', {
|
|
|
|
detail: {
|
|
|
|
post: this._post,
|
|
|
|
},
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-22 10:03:38 +02:00
|
|
|
_evtMergeClick(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
this.dispatchEvent(new CustomEvent('merge', {
|
|
|
|
detail: {
|
|
|
|
post: this._post,
|
|
|
|
},
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
2016-08-02 11:05:40 +02:00
|
|
|
_evtDeleteClick(e) {
|
2016-08-22 01:25:10 +02:00
|
|
|
e.preventDefault();
|
2016-08-02 11:05:40 +02:00
|
|
|
if (confirm('Are you sure you want to delete this post?')) {
|
|
|
|
this.dispatchEvent(new CustomEvent('delete', {
|
|
|
|
detail: {
|
|
|
|
post: this._post,
|
|
|
|
},
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-22 13:27:52 +02:00
|
|
|
_evtNoteTextChangeRequest(e) {
|
|
|
|
if (this._editedNote) {
|
|
|
|
this._editedNote.text = this._noteTextareaNode.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_evtNoteFocus(e) {
|
|
|
|
this._editedNote = e.detail.note;
|
|
|
|
this._addNoteLinkNode.classList.remove('inactive');
|
|
|
|
this._deleteNoteLinkNode.classList.remove('inactive');
|
|
|
|
this._noteTextareaNode.removeAttribute('disabled');
|
|
|
|
this._noteTextareaNode.value = e.detail.note.text;
|
|
|
|
}
|
|
|
|
|
|
|
|
_evtNoteBlur(e) {
|
|
|
|
this._evtNoteTextChangeRequest(null);
|
|
|
|
this._addNoteLinkNode.classList.remove('inactive');
|
|
|
|
this._deleteNoteLinkNode.classList.add('inactive');
|
|
|
|
this._noteTextareaNode.blur();
|
|
|
|
this._noteTextareaNode.setAttribute('disabled', 'disabled');
|
|
|
|
this._noteTextareaNode.value = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
_evtAddNoteClick(e) {
|
2016-08-22 01:25:10 +02:00
|
|
|
e.preventDefault();
|
2016-07-22 13:27:52 +02:00
|
|
|
if (e.target.classList.contains('inactive')) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this._addNoteLinkNode.classList.add('inactive');
|
|
|
|
this._postNotesOverlayControl.switchToDrawing();
|
|
|
|
}
|
|
|
|
|
2017-08-25 23:53:51 +02:00
|
|
|
_evtCopyNotesClick(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
let textarea = document.createElement('textarea');
|
|
|
|
textarea.style.position = 'fixed';
|
|
|
|
textarea.style.opacity = '0';
|
|
|
|
textarea.value = JSON.stringify([...this._post.notes].map(note => ({
|
|
|
|
polygon: [...note.polygon].map(
|
|
|
|
point => [point.x, point.y]),
|
|
|
|
text: note.text,
|
|
|
|
})));
|
|
|
|
document.body.appendChild(textarea);
|
|
|
|
textarea.select();
|
|
|
|
|
|
|
|
let success = false;
|
|
|
|
try {
|
|
|
|
success = document.execCommand('copy');
|
|
|
|
} catch (err) {
|
|
|
|
}
|
|
|
|
textarea.blur();
|
|
|
|
document.body.removeChild(textarea);
|
|
|
|
alert(success
|
|
|
|
? 'Notes copied to clipboard.'
|
|
|
|
: 'Failed to copy the text to clipboard. Sorry.');
|
|
|
|
}
|
|
|
|
|
|
|
|
_evtPasteNotesClick(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
const text = window.prompt(
|
|
|
|
'Please enter the exported notes snapshot:');
|
|
|
|
if (!text) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const notesObj = JSON.parse(text);
|
|
|
|
this._post.notes.clear();
|
|
|
|
for (let noteObj of notesObj) {
|
|
|
|
let note = new Note();
|
|
|
|
for (let pointObj of noteObj.polygon) {
|
|
|
|
note.polygon.add(new Point(pointObj[0], pointObj[1]));
|
|
|
|
}
|
|
|
|
note.text = noteObj.text;
|
|
|
|
this._post.notes.add(note);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-22 13:27:52 +02:00
|
|
|
_evtDeleteNoteClick(e) {
|
2016-08-22 01:25:10 +02:00
|
|
|
e.preventDefault();
|
2016-07-22 13:27:52 +02:00
|
|
|
if (e.target.classList.contains('inactive')) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this._post.notes.remove(this._editedNote);
|
|
|
|
this._postNotesOverlayControl.switchToPassiveEdit();
|
|
|
|
}
|
|
|
|
|
2016-07-03 13:46:49 +02:00
|
|
|
_evtSubmit(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
this.dispatchEvent(new CustomEvent('submit', {
|
|
|
|
detail: {
|
|
|
|
post: this._post,
|
2016-07-26 19:58:26 +02:00
|
|
|
|
2016-10-23 19:47:59 +02:00
|
|
|
safety: this._safetyButtonNodes.length ?
|
2016-07-03 13:46:49 +02:00
|
|
|
Array.from(this._safetyButtonNodes)
|
|
|
|
.filter(node => node.checked)[0]
|
2016-07-26 19:58:26 +02:00
|
|
|
.value.toLowerCase() :
|
|
|
|
undefined,
|
|
|
|
|
2018-09-13 21:48:13 +02:00
|
|
|
flags: this._videoFlags,
|
2016-07-26 20:37:55 +02:00
|
|
|
|
2016-07-26 19:58:26 +02:00
|
|
|
tags: this._tagInputNode ?
|
|
|
|
misc.splitByWhitespace(this._tagInputNode.value) :
|
|
|
|
undefined,
|
|
|
|
|
|
|
|
relations: this._relationsInputNode ?
|
2017-02-05 16:54:01 +01:00
|
|
|
misc.splitByWhitespace(this._relationsInputNode.value)
|
|
|
|
.map(x => parseInt(x)) :
|
2016-07-26 19:58:26 +02:00
|
|
|
undefined,
|
2016-07-27 22:27:33 +02:00
|
|
|
|
|
|
|
content: this._newPostContent ?
|
|
|
|
this._newPostContent :
|
|
|
|
undefined,
|
2016-07-28 19:28:48 +02:00
|
|
|
|
2016-07-31 23:54:29 +02:00
|
|
|
thumbnail: this._newPostThumbnail !== undefined ?
|
2016-07-28 19:28:48 +02:00
|
|
|
this._newPostThumbnail :
|
|
|
|
undefined,
|
2018-12-27 10:22:36 +01:00
|
|
|
|
|
|
|
source: this._sourceInputNode ?
|
|
|
|
this._sourceInputNode.value :
|
|
|
|
undefined,
|
2016-07-03 13:46:49 +02:00
|
|
|
},
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
get _formNode() {
|
|
|
|
return this._hostNode.querySelector('form');
|
|
|
|
}
|
|
|
|
|
|
|
|
get _submitButtonNode() {
|
|
|
|
return this._hostNode.querySelector('.submit');
|
|
|
|
}
|
|
|
|
|
|
|
|
get _safetyButtonNodes() {
|
|
|
|
return this._formNode.querySelectorAll('.safety input');
|
|
|
|
}
|
|
|
|
|
|
|
|
get _tagInputNode() {
|
|
|
|
return this._formNode.querySelector('.tags input');
|
|
|
|
}
|
|
|
|
|
2016-07-26 20:37:55 +02:00
|
|
|
get _loopVideoInputNode() {
|
|
|
|
return this._formNode.querySelector('.flags input[name=loop]');
|
|
|
|
}
|
|
|
|
|
2018-09-13 21:48:13 +02:00
|
|
|
get _soundVideoInputNode() {
|
|
|
|
return this._formNode.querySelector('.flags input[name=sound]');
|
|
|
|
}
|
|
|
|
|
|
|
|
get _videoFlags() {
|
|
|
|
if (!this._loopVideoInputNode) return undefined;
|
|
|
|
let ret = [];
|
|
|
|
if (this._loopVideoInputNode.checked) ret.push('loop');
|
|
|
|
if (this._soundVideoInputNode.checked) ret.push('sound');
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-07-03 13:46:49 +02:00
|
|
|
get _relationsInputNode() {
|
|
|
|
return this._formNode.querySelector('.relations input');
|
2016-06-06 20:57:22 +02:00
|
|
|
}
|
2016-07-27 22:27:33 +02:00
|
|
|
|
|
|
|
get _contentInputNode() {
|
|
|
|
return this._formNode.querySelector('.post-content .dropper-container');
|
|
|
|
}
|
2016-07-28 19:28:48 +02:00
|
|
|
|
|
|
|
get _thumbnailInputNode() {
|
|
|
|
return this._formNode.querySelector(
|
|
|
|
'.post-thumbnail .dropper-container');
|
|
|
|
}
|
2016-07-30 16:13:07 +02:00
|
|
|
|
2016-07-31 23:54:29 +02:00
|
|
|
get _thumbnailRemovalLinkNode() {
|
|
|
|
return this._formNode.querySelector('.post-thumbnail a');
|
|
|
|
}
|
|
|
|
|
2018-12-27 10:22:36 +01:00
|
|
|
get _sourceInputNode() {
|
|
|
|
return this._formNode.querySelector('.post-source input');
|
|
|
|
}
|
|
|
|
|
2016-08-02 10:37:56 +02:00
|
|
|
get _featureLinkNode() {
|
|
|
|
return this._formNode.querySelector('.management .feature');
|
|
|
|
}
|
|
|
|
|
2016-10-22 10:03:38 +02:00
|
|
|
get _mergeLinkNode() {
|
|
|
|
return this._formNode.querySelector('.management .merge');
|
|
|
|
}
|
|
|
|
|
2016-08-02 11:05:40 +02:00
|
|
|
get _deleteLinkNode() {
|
|
|
|
return this._formNode.querySelector('.management .delete');
|
|
|
|
}
|
|
|
|
|
2016-07-22 13:27:52 +02:00
|
|
|
get _addNoteLinkNode() {
|
|
|
|
return this._formNode.querySelector('.notes .add');
|
|
|
|
}
|
|
|
|
|
2017-08-25 23:53:51 +02:00
|
|
|
get _copyNotesLinkNode() {
|
|
|
|
return this._formNode.querySelector('.notes .copy');
|
|
|
|
}
|
|
|
|
|
|
|
|
get _pasteNotesLinkNode() {
|
|
|
|
return this._formNode.querySelector('.notes .paste');
|
|
|
|
}
|
|
|
|
|
2016-07-22 13:27:52 +02:00
|
|
|
get _deleteNoteLinkNode() {
|
|
|
|
return this._formNode.querySelector('.notes .delete');
|
|
|
|
}
|
|
|
|
|
|
|
|
get _noteTextareaNode() {
|
|
|
|
return this._formNode.querySelector('.notes textarea');
|
|
|
|
}
|
|
|
|
|
2016-07-30 16:13:07 +02:00
|
|
|
enableForm() {
|
|
|
|
views.enableForm(this._formNode);
|
|
|
|
}
|
|
|
|
|
|
|
|
disableForm() {
|
|
|
|
views.disableForm(this._formNode);
|
|
|
|
}
|
|
|
|
|
2016-07-31 23:55:22 +02:00
|
|
|
clearMessages() {
|
|
|
|
views.clearMessages(this._hostNode);
|
|
|
|
}
|
|
|
|
|
2016-07-30 16:13:07 +02:00
|
|
|
showSuccess(message) {
|
|
|
|
views.showSuccess(this._hostNode, message);
|
|
|
|
}
|
|
|
|
|
|
|
|
showError(message) {
|
|
|
|
views.showError(this._hostNode, message);
|
|
|
|
}
|
2016-06-06 20:57:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = PostEditSidebarControl;
|