This repository has been archived by the owner on Apr 11, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11cbc0d
commit 54140d5
Showing
16 changed files
with
1,302 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
.openbc_poule | ||
{ | ||
position: absolute; | ||
|
||
width: 100%; | ||
max-width: 1220px; | ||
|
||
margin-left: calc((100% - 1220px) / 2); | ||
|
||
height: 100vh; | ||
top: 0; | ||
|
||
display: none; | ||
} | ||
|
||
.displayed | ||
{ | ||
display: block; | ||
} | ||
|
||
.bc-fone | ||
{ | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
|
||
width: 100vw; | ||
height: 100vh; | ||
background: #000; | ||
opacity: 0; | ||
|
||
z-index: 15; | ||
|
||
transition: all .3s; | ||
} | ||
|
||
.bc-fone-opacity | ||
{ | ||
opacity: var(--blackout); | ||
} | ||
|
||
.bc-loaded-post | ||
{ | ||
position: absolute; | ||
width: 100%; | ||
max-width: 700px; | ||
padding: 3px 0; | ||
background: #171717; | ||
border: 1px solid #333; | ||
border-radius: 6px; | ||
z-index: 15; | ||
left: 100px; | ||
top: 27px; | ||
|
||
overflow: hidden; | ||
height: auto; | ||
opacity: 0; | ||
|
||
max-height: 65px; | ||
transition: all .4s cubic-bezier(1, 0.27, 0.93, 0.54), opacity .3s; | ||
} | ||
|
||
.bc-loaded-post-opacity | ||
{ | ||
opacity: 1; | ||
} | ||
|
||
.bc-loaded-post usercode | ||
{ | ||
display: block; | ||
padding: 4px 10px; | ||
border-bottom: 1px solid #333; | ||
|
||
font-size: 12px; | ||
} | ||
|
||
.bc-loaded-post postmessage | ||
{ | ||
display: block; | ||
padding: 4px 8px; | ||
} | ||
|
||
.bc-loaded-post img | ||
{ | ||
max-width: 100%; | ||
} | ||
|
||
.bc-loaded-post postmessage > p { | ||
font-size: 12px; | ||
padding: 0px 5px; | ||
line-height: 16px; | ||
} | ||
|
||
.bc-loaded-post loadpost | ||
{ | ||
position: relative; | ||
display: block; | ||
|
||
background: #333; | ||
border-radius: 6px; | ||
margin: 4px 0; | ||
} | ||
|
||
|
||
|
||
.bc-loaded-post .bc-nickname | ||
{ | ||
padding: 0px 5px; | ||
font-size: 12px; | ||
} | ||
|
||
.bc-loaded-post .bc-loadpost | ||
{ | ||
position: relative; | ||
|
||
font-size: 11px; | ||
padding: 1px 6px; | ||
background: #222; | ||
border-radius: 6px; | ||
max-height: 34px; | ||
overflow: hidden; | ||
} | ||
|
||
.bc-loaded-post .bottomborder | ||
{ | ||
position: absolute; | ||
|
||
width: 100%; | ||
height: 36px; | ||
top: 0; | ||
background: linear-gradient(to top, #222 0px, #fff0 12px, #fff0 100%); | ||
border-bottom-left-radius: 6px; | ||
border-bottom-right-radius: 6px; | ||
} | ||
|
||
.max-height-auto | ||
{ | ||
max-height: 1000px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/** | ||
* Смена страниц | ||
*/ | ||
function adoor (elem) | ||
{ | ||
var flag = ''; | ||
|
||
if (!__('.open', afp)) | ||
{ | ||
afp.classList.toggle('open'); | ||
afp.classList.toggle('margin'); | ||
} | ||
|
||
__(`backfon.${elem}`, afp).classList.toggle('open'); | ||
if (flag = __(elem, afp).classList.toggle('open')) | ||
{ | ||
__(`backfon.${elem}`, afp).classList.toggle('margin'); | ||
__(elem, afp).classList.toggle('margin'); | ||
} | ||
else | ||
{ | ||
setTimeout | ||
( function () { | ||
__(`backfon.${elem}`, afp).classList.toggle('margin'); | ||
__(elem, afp).classList.toggle('margin'); | ||
}, 400); | ||
} | ||
|
||
if (elem == 'saveto' && flag) | ||
saveTo(); | ||
|
||
if (!__('.open', afp)) | ||
{ | ||
setTimeout | ||
( function () { | ||
afp.classList.toggle('open'); | ||
afp.classList.toggle('margin'); | ||
}, 400); | ||
} | ||
} | ||
|
||
/** | ||
* Управление уведомлениями | ||
*/ | ||
function openAlert ({text, wait, button, titleOf}) | ||
{ | ||
if (titleOf == 'none') __('top', alert).style.setProperty('display', 'none'); | ||
var header = titleOf || 'Уведомление'; | ||
|
||
__('top', alert).textContent = header; | ||
__('middle', alert).innerHTML = text; | ||
|
||
adoor('alert'); | ||
|
||
if (wait) | ||
{ | ||
if (button) | ||
{ | ||
alert.appendChild | ||
( dom (` | ||
<bottom></bottom> | ||
`)); | ||
|
||
bottom = __('bottom', alert); | ||
|
||
button.forEach | ||
( function (a) { | ||
log(a); | ||
bottom.appendChild | ||
( dom(` | ||
<fing onclick="${a.callback}; adoor('alert'); this.parentElement.outerHTML = '';"> | ||
${a.value} | ||
</fing> | ||
`)); | ||
}); | ||
} | ||
|
||
// На случай бесконечного уведомления возможность закрыть | ||
__('fullpage backfon.alert').setAttribute | ||
( | ||
'onclick', | ||
`adoor('alert'); this.querySelector('bottom').outerHTML = ''; this.querySelector('top').style = ''; this.onclick = 'return false;'` | ||
); | ||
} | ||
else | ||
{ | ||
// Временное уведомление закрывается само | ||
setTimeout | ||
(function () { | ||
adoor('alert'); | ||
}, 2000); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
var open_count = 0, left = 0, | ||
poule = dom(`<div class='openbc_poule'></div>`); | ||
|
||
if (!has('breadcrumb-isCascade')) | ||
{ | ||
log('[breadcrumb] Установлены первоначальные настройки'); | ||
|
||
set('breadcrumb-isCascade', 'true'); | ||
set('breadcrumb-left', '160'); | ||
set('breadcrumb-blackout', '0.5'); | ||
|
||
} | ||
|
||
document.addEventListener | ||
("DOMContentLoaded", function () { | ||
document.body.appendChild(poule); | ||
|
||
document.body.style.setProperty('--blackout', | ||
get('breadcrumb-blackout')); | ||
}); | ||
|
||
watching | ||
({ | ||
elem: 'blockquote.messageText div.attribution a', | ||
bool: true, | ||
|
||
callback: function (el) | ||
{ | ||
el.addEventListener('click', {handleEvent: openbc, b: true}); | ||
} | ||
}); | ||
|
||
function closebc () | ||
{ | ||
open_count--; | ||
var post_id = this.getAttribute('data-post-id'); | ||
|
||
if (open_count == 0) | ||
if (poule.classList.contains('displayed')) | ||
poule.classList.remove('displayed'); | ||
|
||
this.outerHTML = ''; | ||
__(`.bc-loaded-post[data-post-id='${post_id}']`).outerHTML = ''; | ||
} | ||
|
||
function openbc (e) | ||
{ | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
open_count++; | ||
left = parseInt(get('breadcrumb-left')); | ||
|
||
var element = e.target, | ||
flag = this.b, | ||
x = 0; | ||
|
||
if (get('breadcrumb-isCascade') == 'true') | ||
{ | ||
if (Math.floor(open_count / 5) & 1) | ||
x = (300 + left) - (60 * (open_count % 5)); | ||
else | ||
x = left + (60 * (open_count % 5)); | ||
} | ||
else | ||
{ | ||
x = parseInt(get('breadcrumb-blackout')); | ||
} | ||
|
||
var y = e.pageY, | ||
p = element.parentElement.parentElement, | ||
post_id = p.getAttribute('data-post-id'), | ||
author = p.getAttribute('data-author'), | ||
set = __(`.bc-loaded-post`), | ||
ob = dom( | ||
`<div class='bc-loaded-post' data-post-id='${post_id}' data-author='${author}' style='left: ${x}px; top: ${y}px;'> | ||
<usercode>Сообщение ${author} <code>#${post_id}</code></usercode> | ||
<postmessage data-post-id='${post_id}' data-author='${author}'> | ||
Загрузка... | ||
</postmessage> | ||
</div>` | ||
), | ||
bc_fone = dom( | ||
`<div class='bc-fone' | ||
data-post-id='${post_id}' | ||
onclick='closebc.call(this)' | ||
onmouseover="this.classList.remove('bc-fone-opacity')" | ||
onmouseout="this.classList.add('bc-fone-opacity')"></div>` | ||
); | ||
|
||
poule.appendChild(bc_fone); | ||
poule.appendChild(ob); | ||
|
||
if (!poule.classList.contains('displayed')) | ||
poule.classList.add('displayed'); | ||
|
||
setTimeout | ||
( function () { | ||
bc_fone.classList.add('bc-fone-opacity'); | ||
ob.classList.add('bc-loaded-post-opacity'); | ||
}); | ||
|
||
requestHandler.ajaxRequest | ||
("/api/forum/getPostCode", { | ||
pid: post_id, | ||
quotes: true, | ||
type: 'post' | ||
}, function (response) { | ||
switch (response.status) { | ||
case "success": | ||
data = Base64.decode(response.data); | ||
data = data.replace( | ||
/<p>\[QUOTE=\"(.*?), post: (.*?), member: (.*?)\"\]<\/p>(.*?)<p>\[\/QUOTE\]<\/p>/ig, | ||
"<loadpost data-post-id='$2' data-author='$1'><div class='bc-nickname'>$1<a onclick='openbc.call(this, event, true); return false;'>#$2</a></div><div class='bc-loadpost'>$4<div class='bottomborder'></div></div></loadpost>" | ||
) | ||
|
||
__('postmessage', ob).innerHTML = data; | ||
ob.classList.add('max-height-auto'); | ||
break; | ||
case "invalidPost": | ||
Utils.notify("Некорректный пост", "warning", 6e3); | ||
break; | ||
default: | ||
Utils.notify("Произошла неизвестная ошибка", "danger"); | ||
} | ||
}, true); | ||
} |
Oops, something went wrong.