Compare commits

...

7 commits

7 changed files with 34 additions and 19 deletions

View file

@ -138,13 +138,13 @@ final class Account extends VKAPIRequestHandler
$user->setSex($sex == 1 ? 1 : 0);
}
if ($relation > -1) {
if ($relation > -1 && $relation <= 8) {
$user->setMarital_Status($relation);
}
if (!empty($bdate)) {
$birthday = strtotime($bdate);
if (!is_int($birthday)) {
if (!is_int($birthday) || $birthday > time()) {
$this->fail(100, "invalid value of bdate.");
}
@ -173,7 +173,12 @@ final class Account extends VKAPIRequestHandler
if ($sex > 0 || $relation > -1 || $bdate_visibility > 1 || !empty("$first_name$last_name$screen_name$bdate$home_town$status")) {
$output["changed"] = 1;
$user->save();
try {
$user->save();
} catch(\TypeError $e) {
$output["changed"] = 0;
}
}
return (object) $output;

View file

@ -429,6 +429,11 @@ class Club extends RowModel
$this->save();
}
public function delete(bool $softly = true): void
{
$this->ban("");
}
public function unban(): void
{
$this->setBlock_Reason(null);

View file

@ -333,7 +333,7 @@ async function __docAttachment(form, ctx = "wall", source = "user", source_arg =
<text id="photo_com_title_photos">
${tr("select_doc")}
</text>
<span style="display: inline-flex;gap: 7px;">
<span style="display: inline-flex;gap: 7px;margin-left: 5px;">
${source != "user" ? `<a id="_doc_picker_go_to_my">${tr("go_to_my_documents")}</a>`: ""}
<a id="_doc_picker_upload">${tr("upload_button")}</a>
</span>

View file

@ -12,7 +12,7 @@ $(document).on("change", ".photo_ajax_upload_button", (e) => {
return;
}
if(file.size > 5 * 1024 * 1024) {
if(file.size > window.openvk.max_filesize_mb * 1024 * 1024) {
MessageBox(tr("error"), tr("max_filesize", 5), [tr("ok")], [() => {Function.noop}])
return;
}
@ -88,7 +88,6 @@ $(document).on("click", ".photo_upload_container #endUploading", (e) => {
data.append("hash", u("meta[name=csrf]").attr("value"))
let xhr = new XMLHttpRequest()
// в самом вк на каждое изменение описания отправляется свой запрос, но тут мы экономим запросы
xhr.open("POST", "/photos/upload?act=finish&album="+document.getElementById("album").value)
xhr.onloadstart = () => {
@ -108,10 +107,10 @@ $(document).on("click", ".photo_upload_container #endUploading", (e) => {
document.querySelector(".page_content .insertPhotos").innerHTML = ""
document.getElementById("endUploading").style.display = "none"
NewNotification(tr("photos_successfully_uploaded"), tr("click_to_go_to_album"), null, () => {window.router.route({url:`/album${result.owner}_${result.album}`})})
window.router.route({url:`/album${result.owner}_${result.album}`})
document.querySelector(".whiteBox").style.display = "block"
document.querySelector(".insertAgain").append(document.getElementById("fakeButton"))
/*document.querySelector(".whiteBox").style.display = "block"
document.querySelector(".insertAgain").append(document.getElementById("fakeButton"))*/
}
e.currentTarget.removeAttribute("disabled")

View file

@ -1967,10 +1967,10 @@ async function repost(id, repost_type = 'post') {
title: tr('share'),
unique_name: 'repost_modal',
body: `
<div class='display_flex_column' style='gap: 1px;'>
<div class='display_flex_column' style='gap: 5px;'>
<b>${tr('auditory')}</b>
<div class='display_flex_column'>
<div class='display_flex_column' style="gap: 2px;padding-left: 1px;">
<label>
<input type="radio" name="repost_type" value="wall" checked>
${tr("in_wall")}
@ -1986,12 +1986,14 @@ async function repost(id, repost_type = 'post') {
<b>${tr('your_comment')}</b>
<input type='hidden' id='repost_attachments'>
<textarea id='repostMsgInput' placeholder='...'></textarea>
<div style="padding-left: 1px;">
<input type='hidden' id='repost_attachments'>
<textarea id='repostMsgInput' placeholder='...'></textarea>
<div id="repost_signs" class='display_flex_column' style='display:none;'>
<label><input type='checkbox' name="asGroup">${tr('post_as_group')}</label>
<label><input type='checkbox' name="signed">${tr('add_signature')}</label>
<div id="repost_signs" class='display_flex_column' style='display:none;'>
<label><input type='checkbox' name="asGroup">${tr('post_as_group')}</label>
<label><input type='checkbox' name="signed">${tr('add_signature')}</label>
</div>
</div>
</div>
`,
@ -2060,7 +2062,7 @@ async function repost(id, repost_type = 'post') {
]
});
u('.ovk-diag-body').attr('style', 'padding: 14px;')
u('.ovk-diag-body').attr('style', 'padding: 18px;')
u('.ovk-diag-body').on('change', `input[name='repost_type']`, (e) => {
const value = e.target.value
@ -2086,6 +2088,7 @@ async function repost(id, repost_type = 'post') {
if(window.openvk.writeableClubs.items.length < 1) {
u(`input[name='repost_type'][value='group']`).attr('disabled', 'disabled')
u(`input[name='repost_type'][value='group']`).closest("label").addClass("lagged")
}
}
@ -2424,6 +2427,9 @@ const showMoreObserver = new IntersectionObserver(entries => {
if(target.length < 1 || target.hasClass('paginator-at-top')) {
return
}
if(target.hasClass('lagged')) {
return
}
const current_url = new URL(location.href)
if(current_url.searchParams && !isNaN(parseInt(current_url.searchParams.get('p')))) {

View file

@ -505,7 +505,7 @@
"edit_photo" = "Edit photo";
"creating_album" = "Creating album";
"delete_photo" = "Delete photo";
"sure_deleting_photo" = "Do you really want to delete this picture?";
"sure_deleting_photo" = "Do you sure you want to delete this photo from album?";
"upload_photo" = "Upload photo";
"photo" = "Photo";
"upload_button" = "Upload";

View file

@ -489,7 +489,7 @@
"edit_photo" = "Изменить фотографию";
"creating_album" = "Создание альбома";
"delete_photo" = "Удалить фотографию";
"sure_deleting_photo" = "Вы уверены, что хотите удалить эту фотографию?";
"sure_deleting_photo" = "Вы уверены, что хотите удалить эту фотографию из альбома?";
"upload_photo" = "Загрузить фотографию";
"photo" = "Фотография";
"upload_button" = "Загрузить";