mirror of
https://github.com/claradex/nativegallery.git
synced 2025-02-21 19:22:24 +03:00
materials update
This commit is contained in:
parent
8087b7c720
commit
2e5c8ffbb0
8 changed files with 31 additions and 19 deletions
|
@ -68,3 +68,5 @@ ngallery:
|
||||||
allowgif: true
|
allowgif: true
|
||||||
comments:
|
comments:
|
||||||
premoderation: false
|
premoderation: false
|
||||||
|
contests:
|
||||||
|
enabled: true
|
||||||
|
|
|
@ -371,10 +371,10 @@ table.nospaces > tbody > tr > td.lcol { padding:2px 6px 0; }
|
||||||
.flag-left { padding-left:26px !important; }
|
.flag-left { padding-left:26px !important; }
|
||||||
.input-flag { margin:-2px -26px 0 5px; position:relative; z-index:11; }
|
.input-flag { margin:-2px -26px 0 5px; position:relative; z-index:11; }
|
||||||
|
|
||||||
.contestBtn { display:block; cursor:pointer; width:56px; height:28px; margin:10px; background:url('/img/vote_contest.gif') no-repeat; opacity:0.7; }
|
.contestBtn { display:block; cursor:pointer; width:56px; height:28px; margin:10px; background:url('/static/img/vote_contest.gif') no-repeat; opacity:0.7; }
|
||||||
.contestBtn:hover { opacity:1; }
|
.contestBtn:hover { opacity:1; }
|
||||||
.contestBtn.voted { opacity:1; background:url('/img/vote_contest_pressed.gif') no-repeat; }
|
.contestBtn.voted { opacity:1; background:url('/static/img/vote_contest_pressed.gif') no-repeat; }
|
||||||
.contestBtn.loading { opacity:1; background:url('/img/vote_contest_loading.gif') no-repeat; }
|
.contestBtn.loading { opacity:1; background:url('/static/img/vote_contest_loading.gif') no-repeat; }
|
||||||
|
|
||||||
.died { border:solid 1px black; padding:0 2px; }
|
.died { border:solid 1px black; padding:0 2px; }
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 215 KiB |
BIN
static/img/vote_contest.gif
Normal file
BIN
static/img/vote_contest.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
static/img/vote_contest_loading.gif
Normal file
BIN
static/img/vote_contest_loading.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
static/img/vote_contest_pressed.gif
Normal file
BIN
static/img/vote_contest_pressed.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -1,21 +1,22 @@
|
||||||
function changeTab(id) {
|
function changeTab(id) {
|
||||||
const $activeTabs = $('.v-tab-b.v-tab--active');
|
const $activeTabs = $('.v-tab-b.v-tab--active');
|
||||||
const $activeBlocks = $('.active__block');
|
const $activeBlocks = $('.active__block');
|
||||||
|
const $newTab = $('#' + id);
|
||||||
|
|
||||||
if ($activeTabs.length) {
|
if ($activeTabs.length) {
|
||||||
$activeTabs.removeClass('v-tab--active');
|
$activeTabs.removeClass('v-tab--active');
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#' + id).addClass('v-tab--active');
|
$newTab.addClass('v-tab--active');
|
||||||
|
|
||||||
if ($activeBlocks.length) {
|
if ($activeBlocks.length) {
|
||||||
$activeBlocks.animate({
|
$activeBlocks.stop(true, true).animate({
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
}, 200, function () {
|
}, 200, function () {
|
||||||
$(this).css('display', 'none').removeClass('active__block');
|
$(this).css('display', 'none').removeClass('active__block');
|
||||||
|
|
||||||
// Вторая анимация
|
const $newBlock = $('#' + id + '__block');
|
||||||
$('#' + id + '__block').css({
|
$newBlock.css({
|
||||||
display: 'block',
|
display: 'block',
|
||||||
opacity: 0
|
opacity: 0
|
||||||
}).animate({
|
}).animate({
|
||||||
|
@ -24,5 +25,15 @@ function changeTab(id) {
|
||||||
$(this).addClass('active__block');
|
$(this).addClass('active__block');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
// Если нет активных блоков, сразу показываем новый блок
|
||||||
|
$('#' + id + '__block').css({
|
||||||
|
display: 'block',
|
||||||
|
opacity: 0
|
||||||
|
}).animate({
|
||||||
|
opacity: 1
|
||||||
|
}, 150, function () {
|
||||||
|
$(this).addClass('active__block');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,9 +87,8 @@ $(document).ready(function()
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#votes').html(html)[html == '' ? 'hide' : 'show']();
|
$('#votes').html(html)[html == '' ? 'hide' : 'show']();
|
||||||
|
$('.vote[pid="' + pid + '"][vote="1"]')[data.buttons.posbtn ? 'addClass' : 'removeClass']('voted');
|
||||||
$('.vote_btn[vote="1"]')[data.buttons[1] ? 'addClass' : 'removeClass']('voted');
|
$('.vote[pid="' + pid + '"][vote="0"]')[data.buttons.negbtn ? 'addClass' : 'removeClass']('voted')
|
||||||
$('.vote_btn[vote="0"]')[data.buttons[0] ? 'addClass' : 'removeClass']('voted');
|
|
||||||
|
|
||||||
var rating = parseInt(data.rating);
|
var rating = parseInt(data.rating);
|
||||||
if (rating > 0) $('#rating').html('+' + rating); else
|
if (rating > 0) $('#rating').html('+' + rating); else
|
||||||
|
@ -127,19 +126,19 @@ $(document).ready(function()
|
||||||
|
|
||||||
$(this).toggleClass('voted');
|
$(this).toggleClass('voted');
|
||||||
if ($(this).is('.voted')) $('.vote[pid="' + pid + '"] .konk_btn[vote="' + Number(!Number(vote)) + '"]').removeClass('voted');
|
if ($(this).is('.voted')) $('.vote[pid="' + pid + '"] .konk_btn[vote="' + Number(!Number(vote)) + '"]').removeClass('voted');
|
||||||
|
var self_p = 0;
|
||||||
if (!self_p) // Чужие фото
|
if (!self_p) // Чужие фото
|
||||||
{
|
{
|
||||||
$(this).closest('.p20p').removeAttr('class').css('padding', '6px 6px 5px');
|
$(this).closest('.p20p').removeAttr('class').css('padding', '6px 6px 5px');
|
||||||
|
|
||||||
$.getJSON('/api.php', { action: 'vote-konk', pid: pid, vote: vote }, function (data)
|
$.getJSON('/api/photo/vote', { action: 'vote-konk', pid: pid, vote: vote }, function (data)
|
||||||
{
|
{
|
||||||
if (data && !data.errors)
|
if (data && !data.errors)
|
||||||
{
|
{
|
||||||
$('.star[pid="' + pid + '"]').html(data.star ? '<img src="/img/star_' + data.star + '.png" alt="" />' : '');
|
$('.star[pid="' + pid + '"]').html(data.star ? '<img src="/img/star_' + data.star + '.png" alt="" />' : '');
|
||||||
|
$('.vote[pid="' + pid + '"] .konk_btn[vote="1"]')[data.buttons.posbtn_contest ? 'addClass' : 'removeClass']('voted');
|
||||||
|
$('.vote[pid="' + pid + '"] .konk_btn[vote="0"]')[data.buttons.negbtn_contest ? 'addClass' : 'removeClass']('voted');
|
||||||
|
|
||||||
$('.vote[pid="' + pid + '"] .konk_btn[vote="1"]')[data.buttons[1] ? 'addClass' : 'removeClass']('voted');
|
|
||||||
$('.vote[pid="' + pid + '"] .konk_btn[vote="0"]')[data.buttons[0] ? 'addClass' : 'removeClass']('voted');
|
|
||||||
|
|
||||||
var rat = $('.s_rating[pid="' + pid + '"]');
|
var rat = $('.s_rating[pid="' + pid + '"]');
|
||||||
if (rat.length)
|
if (rat.length)
|
||||||
|
@ -164,14 +163,14 @@ $(document).ready(function()
|
||||||
}
|
}
|
||||||
else // Свои фото
|
else // Свои фото
|
||||||
{
|
{
|
||||||
$.getJSON('/api.php', { action: 'vote-author', pid: pid, vote: vote }, function (data)
|
$.getJSON('/api/photo/vote', { action: 'vote-author', pid: pid, vote: vote }, function (data)
|
||||||
{
|
{
|
||||||
if (data && !data.errors)
|
if (data && !data.errors)
|
||||||
{
|
{
|
||||||
$('#star[pid="' + pid + '"]').html(data.star ? '<img src="/img/star_' + data.star + '.png" alt="" />' : '');
|
$('#star[pid="' + pid + '"]').html(data.star ? '<img src="/img/star_' + data.star + '.png" alt="" />' : '');
|
||||||
|
|
||||||
$('.konk_btn[vote="1"]')[data.buttons[1] ? 'addClass' : 'removeClass']('voted');
|
$('.vote[pid="' + pid + '"] .konk_btn[vote="1"]')[data.buttons.posbtn_contest ? 'addClass' : 'removeClass']('voted');
|
||||||
$('.konk_btn[vote="0"]')[data.buttons[0] ? 'addClass' : 'removeClass']('voted');
|
$('.vote[pid="' + pid + '"] .konk_btn[vote="0"]')[data.buttons.negbtn_contest ? 'addClass' : 'removeClass']('voted');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue