ADD: SweetAlert2 (всплывающие окна)

*  A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. https://github.com/sweetalert2/sweetalert2
* Changed the site's footer
This commit is contained in:
Evg 2021-05-24 08:26:41 +03:00
parent 2df4d7629f
commit c11f55d376
21 changed files with 161 additions and 48 deletions

View file

@ -578,7 +578,7 @@ class SpaceController extends \MainController
// title, description
Base::Meta(lang('Edit tag'), lang('Edit tag'), $other = false);
return view(PR_VIEW_DIR . '/space/edit-tag', ['data' => $data, 'uid' => $uid, 'tag' => $tag]);
return view(PR_VIEW_DIR . '/space/edit-tag', ['data' => $data, 'uid' => $uid, 'tag' => $tag, 'space' => $space]);
}
// Изменяем тег пространства

View file

@ -82,4 +82,8 @@ return [
'info_users' => 'The list of participants sorted in the order of registration on the site.',
'info_search' => 'To refine the search, try to find a more accurate query.',
'info_notifications' => 'You can mark all the ads as read, click on the link: «I read».',
'info_space_tags' => 'Tags allow you to filter topics in the feed.',
'info_space_tags_2' => 'If you already have tags, they will be displayed on this page.',
'info_space_edit' => 'Fill in all the required fields. Some fields determine how your space will be visible in search engines.',
'info_space_logo' => 'A lot depends on the logo. It should most accurately display the theme of the space.',
];

View file

@ -238,4 +238,8 @@ return [
'info_users' => 'Список участников отсортированных в порядке регистрации на сайте.',
'info_search' => 'Для уточнения поиска попробуйте подобрать более точный запрос.',
'info_notifications' => 'Вы можете пометить все объявления, как прочитанные, нажать на ссылку: «Я прочитал».',
'info_space_tags' => 'Метки позволяют фильтровать темы в ленте.',
'info_space_tags_2' => 'Если у вас уже есть метки, они будут отображены на этой странице.',
'info_space_edit' => 'Заполните все необходимые поля. От некоторых полей зависит, как ваше пространство будет видно в поисковых системах.',
'info_space_logo' => 'От логотипа многое зависит. Он должен наиболее точно отображать тему пространства.',
];

View file

@ -71,7 +71,7 @@ class Base
// Добавляем сообщение
public static function addMsg($msg, $class='info')
{
$_SESSION['msg'][] = '<div class="fon msg_'.$class.'"><div class="msg_telo">✔ '.$msg.'</div></div>';
$_SESSION['msg'][] = array($msg, $class);
}
// Локализация даты, событий....

View file

@ -42,12 +42,9 @@ input[type="text"] {
display: table-row;
}
.t-th {
font-weight: 600;
}
.t-th {
background: #e3e3e3;
font-weight: 600;
}
.t-td {

View file

@ -1,11 +1,11 @@
/*! Image Uploader - v1.2.3 - 26/11/2019
* Copyright (c) 2019 Christian Bayer; Licensed MIT
* + modification (c) Evg 2021
* Copyright (c) 2019 Christian Bayer; Licensed MIT
* + modification (c) Evg 2021
* Icons Font Face */
.upload-text i.icon,
.delete-image i.icon {
margin-right: 0;
margin-right: 0;
}
.image-uploader {
@ -16,7 +16,7 @@
}
.create .image-uploader,
.edit-post .image-uploader{
.edit-post .image-uploader {
height: 125px;
max-width: 450px;
}
@ -30,7 +30,7 @@
.create .boxline.post .input-images img {
max-height: 140px;
}
/* Base style */
.box.setting.avatar .image-uploader,
.box.setting.space .image-uploader {
border: 1px solid #d9d9d9;
@ -44,12 +44,10 @@
width: 328px;
}
/* Style on hover */
.image-uploader.drag-over {
background-color: #f3f3f3;
}
/* Hide the file input */
.image-uploader input[type="file"] {
width: 0;
height: 0;
@ -58,7 +56,6 @@
opacity: 0;
}
/* Text container */
.image-uploader .upload-text {
position: absolute;
top: 0;

View file

@ -65,10 +65,11 @@ a.space-u.tag-u {
border: 1px solid #ddd;
border-radius: 5px;
font-size: 8pt;
margin-left: 0.25em;
padding: 0px 0.4em 0.4em 0.4em;
padding: 0.2em 0.4em 0.2em 0.4em;
text-decoration: none;
color: #888;
margin: -0.6em 0 0 0.25em;
display: inline-block;
}
.space-color {
@ -230,4 +231,5 @@ a.add-space {
.space-text-sb {
clear: both;
padding-top: 20px;
font-size: 14px;
}

View file

@ -1457,7 +1457,7 @@ h3.recommend {
/* Footer */
footer {
background: #edeeef;
background-color: #edeeef;
clear: both;
color: #333;
padding: 10px 20px 20px 20px;
@ -1589,7 +1589,9 @@ i.github {
.dark a:hover,
.dark .showpost,
.dark .login-nav label {
.dark .login-nav label,
.dark .p-head,
.dark .p-head-n {
color: #eee;
}
@ -1605,7 +1607,8 @@ i.github {
.dark .comments_subtree:target,
.dark .comments_subtree.edit,
.dark .dropdown-menu {
.dark .dropdown-menu,
.dark footer {
background-color: #222;
}

1
public/assets/css/sweetalert2.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -15,7 +15,7 @@
}
.profile-about {
margin: 1px 0 40px 0;
margin: 1px 0 40px 0;
}
.profile-ava {

1
public/assets/js/sweetalert2.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -18,7 +18,7 @@
height: 150px;
}
.wmd-input.w-95 {
.wmd-button-bar .wmd-input.w-95 {
width: 95%;
}
@ -145,8 +145,15 @@
.icon-embed::before { content: "\ea7f"; }
@media (max-width: 880px) {
.wmd-panel { width: 96%; }
.wmd-input, .image-uploader { height: 120px; }
.wmd-panel {
width: 96%;
}
.wmd-input,
.image-uploader {
height: 120px;
}
.wmd-preview {
padding: 0 0 0 1;
margin: 20px 0 0 2px;

View file

@ -39,8 +39,31 @@
</div>
</div>
</footer>
<?php include TEMPLATE_DIR . '/metrika.php'; ?>
<script async src="/assets/js/common.js"></script>
<script async src="/assets/js/common.js"></script>
<script src="/assets/js/sweetalert2.min.js"></script>
<link rel="stylesheet" href="/assets/css/sweetalert2.min.css">
<?php if ($uid['msg']) { ?>
<?php foreach($uid['msg'] as $message) { ?>
<script nonce="<?= $_SERVER['nonce']; ?>">
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: '<?= $message[1]; ?>',
title: '<?= $message[0]; ?>'
})
</script>
<?php } ?>
<?php } ?>
<?php print getRequestResources()->getBottomStyles(); ?>
<?php print getRequestResources()->getBottomScripts(); ?>
</body>
</html>

View file

@ -15,7 +15,6 @@
<link rel="icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/favicon.png">
<link rel="stylesheet" href="/assets/css/style.css">
</head>
@ -129,20 +128,13 @@
</div>
</header>
<?php if(!empty($post['post_title'])) { ?>
<div id="stHeader">
<a href="/"><i class="icon home"></i></a> <span class="slash">\</span> <?= $post['post_title']; ?>
</div>
<?php } ?>
<?php if ($uid['msg']) { ?>
<?php foreach($uid['msg'] as $message) { ?>
<?= $message; ?>
<?php } ?>
<?php } ?>
<?php if(!empty($space_bar)) { ?>
<?php if(!$space_bar && $uid['uri'] == '/') { ?>
<div class="space-no-user">

View file

@ -1 +0,0 @@
<!-- См. https://yandex.ru/support/metrica/code/install-counter-csp.html -->

View file

@ -1,6 +1,25 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main class="w-75">
<h1><?= $data['h1']; ?></h1>
<ul class="nav-tabs">
<li>
<a href="/space/<?= $space['space_slug']; ?>/edit">
<span><?= lang('Edit'); ?> - <?= $space['space_slug']; ?></span>
</a>
</li>
<li>
<a href="/space/<?= $space['space_slug']; ?>/edit/logo">
<span><?= lang('Logo'); ?> / <?= lang('Cover art'); ?></span>
</a>
</li>
<li>
<a href="/space/<?= $space['space_slug']; ?>/tags">
<span><?= lang('Tags'); ?></span>
</a>
</li>
<li class="right active">
<span><?= lang('Add'); ?></span>
</li>
</ul>
<div class="telo space">
<div class="box create">
<form action="/space/tag/add" method="post">
@ -8,12 +27,12 @@
<div class="boxline">
<label for="post_title"><?= lang('Title'); ?></label>
<input class="add" type="text" value="" name="st_title" />
<div class="box_h">От 4 до 20 знаков</div>
<div class="box_h">4 до 20 <?= lang('characters'); ?></div>
</div>
<div class="boxline">
<label for="post_content"><?= lang('Description'); ?></label>
<input class="add" type="text" value="" name="st_desc" />
<div class="box_h">От 20 до 180 знаков</div>
<div class="box_h">20 до 180 <?= lang('characters'); ?></div>
</div>
<input type="hidden" name="space_id" id="space_id" value="<?= $space['space_id']; ?>">
<input type="submit" name="submit" value="<?= lang('Add'); ?>" />
@ -21,4 +40,7 @@
</div>
</div>
</main>
<aside>
<?= lang('info_space_tags'); ?>
</aside>
<?php include TEMPLATE_DIR . '/footer.php'; ?>

View file

@ -4,12 +4,22 @@
<ul class="nav-tabs">
<li>
<a href="/space/<?= $space['space_slug']; ?>/edit">
<span><?= $data['h1']; ?></span>
<span><?= lang('Edit'); ?> - <?= $space['space_slug']; ?></span>
</a>
</li>
<li class="active">
<span><?= lang('Logo'); ?> / <?= lang('Cover art'); ?></span>
</li>
<li>
<a href="/space/<?= $space['space_slug']; ?>/tags">
<span><?= lang('Tags'); ?></span>
</a>
</li>
<li class="right">
<a href="/s/<?= $space['space_slug']; ?>">
<span><?= lang('In space'); ?></span>
</a>
</li>
</ul>
<div class="telo space">
@ -59,4 +69,7 @@
</div>
</div>
</main>
<aside>
<?= lang('info_space_logo'); ?>
</aside>
<?php include TEMPLATE_DIR . '/footer.php'; ?>

View file

@ -16,7 +16,7 @@
</a>
</li>
<li class="right">
<a href="/space/<?= $space['space_slug']; ?>">
<a href="/s/<?= $space['space_slug']; ?>">
<span><?= lang('In space'); ?></span>
</a>
</li>
@ -84,4 +84,7 @@
</div>
</div>
</main>
<aside>
<?= lang('info_space_edit'); ?>
</aside>
<?php include TEMPLATE_DIR . '/footer.php'; ?>

View file

@ -1,6 +1,26 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main class="w-100">
<h1><?= $data['h1']; ?></h1>
<ul class="nav-tabs">
<li class="active">
<span><?= $data['h1']; ?></span>
</li>
<li>
<a href="/space/<?= $space['space_slug']; ?>/edit/logo">
<span><?= lang('Logo'); ?> / <?= lang('Cover art'); ?></span>
</a>
</li>
<li>
<a href="/space/<?= $space['space_slug']; ?>/tags">
<span><?= lang('Tags'); ?></span>
</a>
</li>
<li class="right">
<a href="/s/<?= $space['space_slug']; ?>">
<span><?= lang('In space'); ?></span>
</a>
</li>
</ul>
<div class="telo space">
<div class="box create">
<form action="/space/tag/edit" method="post">
@ -22,4 +42,7 @@
</div>
</div>
</main>
<aside>
<?= lang('info_space_tags'); ?>
</aside>
<?php include TEMPLATE_DIR . '/footer.php'; ?>

View file

@ -1,11 +1,26 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main class="w-75">
<span class="right">
<a href="/space/<?= $space['space_slug']; ?>/tags/add">
<?= lang('Add'); ?>
</a>
</span>
<h1><?= $data['h1']; ?></h1>
<ul class="nav-tabs">
<li>
<a href="/space/<?= $space['space_slug']; ?>/edit">
<span><?= lang('Edit'); ?> - <?= $space['space_slug']; ?></span>
</a>
</li>
<li>
<a href="/space/<?= $space['space_slug']; ?>/edit/logo">
<span><?= lang('Logo'); ?> / <?= lang('Cover art'); ?></span>
</a>
</li>
<li class="active">
<span><?= lang('Tags'); ?></span>
</li>
<li class="right">
<a href="/space/<?= $space['space_slug']; ?>/tags/add">
<span><?= lang('Add'); ?></span>
</a>
</li>
</ul>
<div class="telo space">
<?php if (!empty($tags)) { ?>
<div class="tags">
@ -34,4 +49,9 @@
<?php } ?>
</div>
</main>
<aside>
<?= lang('info_space_tags'); ?>
<br><br>
<?= lang('info_space_tags_2'); ?>
</aside>
<?php include TEMPLATE_DIR . '/footer.php'; ?>

View file

@ -147,7 +147,9 @@
<i class="icon question qa"></i>
<?php } ?>
</a>
<?php if($post['st_id']) { ?>
<a class="space-u tag-u" href="/s/<?= $space_info['space_slug']; ?>/<?= $post['st_id']; ?>" title="<?= $post['st_title']; ?>"><?= $post['st_title']; ?></a>
<?php } ?>
<?php if($post['post_url_domain']) { ?>
<a class="post_url" href="/domain/<?= $post['post_url_domain']; ?>">
<?= $post['post_url_domain']; ?>