mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Compare commits
2 commits
530287feed
...
62645d8cba
Author | SHA1 | Date | |
---|---|---|---|
|
62645d8cba | ||
|
78004b1fab |
4 changed files with 25 additions and 20 deletions
|
@ -34,7 +34,7 @@ final class UserPresenter extends OpenVKPresenter
|
||||||
$this->template->_template = "User/deactivated.xml";
|
$this->template->_template = "User/deactivated.xml";
|
||||||
|
|
||||||
$this->template->user = $user;
|
$this->template->user = $user;
|
||||||
} else if(!$user->canBeViewedBy($this->user->identity)) {
|
} else if(!is_null($user) && !$user->canBeViewedBy($this->user->identity)) {
|
||||||
$this->template->_template = "User/private.xml";
|
$this->template->_template = "User/private.xml";
|
||||||
|
|
||||||
$this->template->user = $user;
|
$this->template->user = $user;
|
||||||
|
|
|
@ -1290,25 +1290,6 @@ u(document).on("drop", '#write', function(e) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
u(document).on('submit', '#write > form', (e) => {
|
|
||||||
const target = u(e.target)
|
|
||||||
const horizontal_array = []
|
|
||||||
const horizontal_input = target.find(`input[name='horizontal_attachments']`)
|
|
||||||
const horizontal_attachments = target.find(`.post-horizontal > a`)
|
|
||||||
horizontal_attachments.nodes.forEach(_node => {
|
|
||||||
horizontal_array.push(`${_node.dataset.type}${_node.dataset.id}`)
|
|
||||||
})
|
|
||||||
horizontal_input.nodes[0].value = horizontal_array.join(',')
|
|
||||||
|
|
||||||
const vertical_array = []
|
|
||||||
const vertical_input = target.find(`input[name='vertical_attachments']`)
|
|
||||||
const vertical_attachments = target.find(`.post-vertical > .vertical-attachment`)
|
|
||||||
vertical_attachments.nodes.forEach(_node => {
|
|
||||||
vertical_array.push(`${_node.dataset.type}${_node.dataset.id}`)
|
|
||||||
})
|
|
||||||
vertical_input.nodes[0].value = vertical_array.join(',')
|
|
||||||
})
|
|
||||||
|
|
||||||
// !!! PHOTO PICKER !!!
|
// !!! PHOTO PICKER !!!
|
||||||
u(document).on("click", "#__photoAttachment", async (e) => {
|
u(document).on("click", "#__photoAttachment", async (e) => {
|
||||||
const photos_per_page = 23
|
const photos_per_page = 23
|
||||||
|
|
|
@ -297,6 +297,11 @@ u(document).on('submit', 'form', async (e) => {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e.target.closest('#write')) {
|
||||||
|
const target = u(e.target)
|
||||||
|
collect_attachments_node(target)
|
||||||
|
}
|
||||||
|
|
||||||
u('#ajloader').addClass('shown')
|
u('#ajloader').addClass('shown')
|
||||||
|
|
||||||
const form = e.target
|
const form = e.target
|
||||||
|
|
|
@ -260,3 +260,22 @@ function sleep(time)
|
||||||
{
|
{
|
||||||
return new Promise((resolve) => setTimeout(resolve, time));
|
return new Promise((resolve) => setTimeout(resolve, time));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function collect_attachments_node(target)
|
||||||
|
{
|
||||||
|
const horizontal_array = []
|
||||||
|
const horizontal_input = target.find(`input[name='horizontal_attachments']`)
|
||||||
|
const horizontal_attachments = target.find(`.post-horizontal > a`)
|
||||||
|
horizontal_attachments.nodes.forEach(_node => {
|
||||||
|
horizontal_array.push(`${_node.dataset.type}${_node.dataset.id}`)
|
||||||
|
})
|
||||||
|
horizontal_input.nodes[0].value = horizontal_array.join(',')
|
||||||
|
|
||||||
|
const vertical_array = []
|
||||||
|
const vertical_input = target.find(`input[name='vertical_attachments']`)
|
||||||
|
const vertical_attachments = target.find(`.post-vertical > .vertical-attachment`)
|
||||||
|
vertical_attachments.nodes.forEach(_node => {
|
||||||
|
vertical_array.push(`${_node.dataset.type}${_node.dataset.id}`)
|
||||||
|
})
|
||||||
|
vertical_input.nodes[0].value = vertical_array.join(',')
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue