Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0
* 2px

* remove useless css rule

* Forgot path=/; in resetCookie()

* forgot a max-width

* Update base.jet.html

* resetCookies() now also triggered by mismatching website version
Cette révision appartient à :
kilo 2017-09-18 06:20:25 +02:00 révisé par ewhal
Parent 2cd80735f2
révision 33e90093b7
3 fichiers modifiés avec 12 ajouts et 20 suppressions

Voir le fichier

@ -42,6 +42,7 @@ img[class$="-w"] {
width: 728px;
position: relative;
z-index: 1;
max-width: 100%;
}
#mascot {
@ -339,7 +340,7 @@ select.form-input {
#content {
position: relative;
top: 53px;
top: 54px;
}
#content.content-admin {
top: 108px!important;
@ -448,7 +449,7 @@ select.form-input {
}
#announce {
margin-bottom: 3px;
margin-bottom: 4px;
padding: 7px 10px;
background-color: #D9EDF7;
border: 1px solid #c4e1e8;
@ -1213,10 +1214,6 @@ thead.torrentinfo tr {
min-height: 40px;
}
.tr-filelist {
--nest-level: 0;
}
.caret-down-icon {
background: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="%232196F3" d="M24 34l18-20H6"/></svg>') no-repeat center center;
background-size: 24px;
@ -1230,9 +1227,6 @@ thead.torrentinfo tr {
text-overflow: ellipsis;
}
/* The margin that gives the tree-like effect, based on the nest-level */
.tr-filelist td:first-child::before {
margin-right: 0.4rem;
}

Voir le fichier

@ -87,9 +87,9 @@ parseAllDates()
//called if no Commit cookie is set or if the website has a newer commit than the one in cookie
function resetCookies() {
var cookies = document.cookie.split(";")
var excludedCookies = ["mascot", "theme", "theme2", "mascot_url", "lang", "csrf_token", "altColors", "EU_Cookie", "oldNav"]
var excludedCookies = ["mascot", "version", "theme", "theme2", "mascot_url", "lang", "csrf_token", "altColors", "EU_Cookie", "oldNav"]
//Remove all cookies but exclude those in the above array
//Remove all cookies but re-create those in the above array
for (var i = 0; i < cookies.length; i++) {
var cookieName = (cookies[i].split("=")[0]).trim()
//Trim spaces because some cookie names have them at times
@ -98,16 +98,17 @@ function resetCookies() {
//only execute if cookie are supposed to be shared between nyaa & sukebei
var cookieValue = getCookieValue(cookieName)
document.cookie = cookieName + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;"
document.cookie = cookieName + "=" + cookieValue + ";expires=" + farFutureString + ";domain=" + domain
document.cookie = cookieName + "=" + cookieValue + ";path=/;expires=" + farFutureString + ";domain=" + domain
//Remove cookie and re-create it to ensure domain is correct
}
continue
}
document.cookie = cookieName + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;"
document.cookie = cookieName + "=;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;"
}
//Set new version in cookie
document.cookie = "commit=" + commitVersion + ";expires=" + farFutureString + ";domain=" + domain
document.cookie = "version=" + websiteVersion + ";expires=" + farFutureString + ";domain=" + domain
var oneHour = new Date()
oneHour.setTime(oneHour.getTime() + 1 * 3600 * 1500)
@ -134,14 +135,11 @@ function startupCode() {
if (location.hash) shiftWindow()
window.addEventListener("hashchange", shiftWindow)
if (!document.cookie.includes("commit"))
if (!document.cookie.includes("commit") && !document.cookie.includes("version"))
resetCookies()
else {
var userCommitVersion = getCookieValue("commit");
//Get start and end position of Commit string, need to start searching endPos from version cookie in case it's not the first cookie in the string
//If endPos is equal to -1, aka if the version cookie is at the very end of the string and doesn't have an ";", the endPos is not used
if (userCommitVersion != commitVersion)
var userCommitVersion = getCookieValue("commit"), userWebsiteVersion = getCookieValue("version");
if (userCommitVersion != commitVersion || userWebsiteVersion != websiteVersion)
resetCookies()
}

Voir le fichier

@ -97,7 +97,7 @@
</div>
</footer>
</div>
<script type="text/javascript">var commitVersion = "{{ Config.Build }}", UserID = {{User.ID}}, domain = "{{getDomainName()}}";</script>
<script type="text/javascript">var commitVersion = "{{ Config.Build }}", websiteVersion = "{{ Config.Version }}", UserID = {{User.ID}}, domain = "{{getDomainName()}}";</script>
<script type="text/javascript" src="/js/query.js?v={{ Config.Version}}{{ Config.Build }}"></script>
<script type="text/javascript" charset="utf-8" src="/js/main.js?v={{ Config.Version }}{{ Config.Build }}" async></script>
{{block footer_js()}}{{end}}