Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Also delete cookies from main domain instead of just current subdomain (#1726)

* Update main.js

* fix folders in filelist

* Update treeview.jet.html
Cette révision appartient à :
kilo 2017-11-09 10:49:01 +01:00 révisé par ewhal
Parent 6a03a75d6b
révision fdd86d6a9e
2 fichiers modifiés avec 15 ajouts et 2 suppressions

Voir le fichier

@ -309,6 +309,19 @@ function deleteCookie(cookieName) {
document.cookie = cookieName + "=;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;"
document.cookie = cookieName + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;domain=" + window.location.host
document.cookie = cookieName + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;domain=" + domain
//Also need to delete from current hostname without subdomain, which is what this accomplish
var hostName = window.location.host
var lastDotIndex = hostName.lastIndexOf(".")
var secondLast = -1
for(var index = 0; index < lastDotIndex; index++) {
if(hostName[index] == '.')
secondLast = index
}
hostName = hostName.substr(secondLast == -1 ? 0 : secondLast)
document.cookie = cookieName + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;domain=" + hostName
}
// @license-end

Voir le fichier

@ -2,9 +2,9 @@
{{ if isset(treeviewData)}}
{{ range index, folder := treeviewData.Folder.Folders }}
{{ folderId := treeviewData.IdentifierChain+"_"+index }}
<tr class="tr-filelist tr-folder>
<tr class="tr-filelist tr-folder">
<td style="padding-left: {{ treeviewData.NestLevel * 2.5 }}%;"><label for="contents_{{folderId}}">{{folder.FolderName}}</label></td>
<td>{{ fileSize(folder.TotalSize(), T) }}</td>
<td>{{ fileSize(folder.TotalSize(), T, true) }}</td>
</tr>
<tr>
<td colspan="2">