mirror of
https://gitlab.com/brutaldon/brutaldon.git
synced 2024-12-04 14:46:24 -05:00
Some small JavaScript fixes
This commit is contained in:
parent
3d44b47f73
commit
9605c04a5f
@ -1,9 +1,3 @@
|
|||||||
function scrollTop()
|
|
||||||
{
|
|
||||||
window.scrollTo(0,0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setTitle(user, page)
|
function setTitle(user, page)
|
||||||
{
|
{
|
||||||
document.title = `Brutaldon (${user}) – ${page}`;
|
document.title = `Brutaldon (${user}) – ${page}`;
|
||||||
@ -72,7 +66,10 @@ function expandCWButtonPrepare()
|
|||||||
theButton.id = "expandCWs";
|
theButton.id = "expandCWs";
|
||||||
theButton.textContent = "Expand CWs";
|
theButton.textContent = "Expand CWs";
|
||||||
theButton.classList.toggle('button');
|
theButton.classList.toggle('button');
|
||||||
document.querySelector('#title').insertAdjacentElement('afterend', theButton);
|
var title = document.querySelector('#title');
|
||||||
|
if (title)
|
||||||
|
{
|
||||||
|
title.insertAdjacentElement('afterend', theButton);
|
||||||
var details = document.querySelectorAll('details');
|
var details = document.querySelectorAll('details');
|
||||||
var openState = false;
|
var openState = false;
|
||||||
|
|
||||||
@ -93,7 +90,8 @@ function expandCWButtonPrepare()
|
|||||||
else { theButton.textContent = "Expand CWs"; };
|
else { theButton.textContent = "Expand CWs"; };
|
||||||
theButton.classList.toggle('is-active');
|
theButton.classList.toggle('is-active');
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +130,7 @@ function fileButtonUpdaters()
|
|||||||
|
|
||||||
function characterCountSetup()
|
function characterCountSetup()
|
||||||
{
|
{
|
||||||
|
if ($("#id_status").length) {
|
||||||
$("#status_count").text(characterCount());
|
$("#status_count").text(characterCount());
|
||||||
$("#id_status").keyup(function(){
|
$("#id_status").keyup(function(){
|
||||||
$("#status_count").text(characterCount());
|
$("#status_count").text(characterCount());
|
||||||
@ -139,6 +138,7 @@ function characterCountSetup()
|
|||||||
$("#id_spoiler_text").keyup(function(){
|
$("#id_spoiler_text").keyup(function(){
|
||||||
$("#status_count").text(characterCount());
|
$("#status_count").text(characterCount());
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function characterCount()
|
function characterCount()
|
||||||
|
Loading…
Reference in New Issue
Block a user