it works merge pls (#1204)
* remove custom_flag.css * remove ' that had nothing to do here * replace sukebei variable to boolean * fix ? operator & variable name * attempt at fixing visual cues for anonymous torrents * Update torrents.jet.html * add missing , * useless code if user logged off so moving that * add it back here and check if logged in * should work almost properly now * same here * flag-other invisible * Update kilo.js * Update upload.jet.html * should work very well now * same here * Delete categories.png * Add files via upload * Update main.css * Update kilo.js * Update upload.jet.html * Update kilo.js * Update torrents.jet.html * proper behavior for trusted people * different flag form id * add id * add language name in an span * make that span invisible =) * Update flags.jet.html * Update upload.jet.html * Update kilo.js * whoever read this is a faggot * Update upload.jet.html
Cette révision appartient à :
Parent
f37f81bead
révision
511d074e84
8 fichiers modifiés avec 93 ajouts et 76 suppressions
2
public/css/flags/flags.min.css
externe
2
public/css/flags/flags.min.css
externe
|
@ -1,3 +1,3 @@
|
|||
/*!
|
||||
* Generated with CSS Flag Sprite generator (https://www.flag-sprites.com
|
||||
*/.flag{display:inline-block;width:16px;height:11px;background:url(flags.png) no-repeat}.flag.flag-zh{background-position:-16px 0}.flag.flag-sv{background-position:-16px -33px}.flag.flag-th{background-position:-32px -33px}.flag.flag-mx{background-position:0 -22px}.flag.flag-pt{background-position:-48px -22px}.flag.flag-ro{background-position:-64px -22px}.flag.flag-nb{background-position:-32px -22px}.flag.flag-es{background-position:-48px 0}.flag.flag-Hant{background-position:-48px -33px}.flag.flag-ru{background-position:0 -33px}.flag.flag-ko{background-position:-64px -11px}.flag.flag-br{background-position:-80px 0}.flag.flag-it{background-position:-32px -11px}.flag.flag-nl{background-position:-16px -22px}.flag.flag-fr{background-position:-64px 0}.flag.flag-de{background-position:-32px 0}.flag.flag-ja{background-position:-48px -11px}.flag.flag-hu{background-position:0 -11px}.flag.flag-en{background-position:-64px -33px}.flag.flag-is{background-position:-16px -11px}.flag.flag-ca{background-position:-80px -11px}.flag.flag-multiple{background-position:-80px -22px}
|
||||
*/.flag{display:inline-block;width:16px;height:11px;background:url(flags.png) no-repeat}.flag.flag-zh{background-position:-16px 0}.flag.flag-sv{background-position:-16px -33px}.flag.flag-th{background-position:-32px -33px}.flag.flag-mx{background-position:0 -22px}.flag.flag-pt{background-position:-48px -22px}.flag.flag-ro{background-position:-64px -22px}.flag.flag-nb{background-position:-32px -22px}.flag.flag-es{background-position:-48px 0}.flag.flag-Hant{background-position:-48px -33px}.flag.flag-ru{background-position:0 -33px}.flag.flag-ko{background-position:-64px -11px}.flag.flag-br{background-position:-80px 0}.flag.flag-it{background-position:-32px -11px}.flag.flag-nl{background-position:-16px -22px}.flag.flag-fr{background-position:-64px 0}.flag.flag-de{background-position:-32px 0}.flag.flag-ja{background-position:-48px -11px}.flag.flag-hu{background-position:0 -11px}.flag.flag-en{background-position:-64px -33px}.flag.flag-is{background-position:-16px -11px}.flag.flag-ca{background-position:-80px -11px}.flag.flag-multiple{background-position:-80px -22px}.flag.flag-other{background: none}
|
||||
|
|
|
@ -151,6 +151,7 @@ select.form-input {
|
|||
}
|
||||
|
||||
.language span.input-group { display: inline-block; }
|
||||
.language span.input-group span { display: none; }
|
||||
.language .input-group label { margin-bottom: 1px; }
|
||||
.language .input-group input { margin-right: 4px; }
|
||||
|
||||
|
@ -1005,27 +1006,27 @@ details[open] summary:after {
|
|||
}
|
||||
|
||||
.nyaa-cat { background: url('/img/categories.png') no-repeat; background-position-x: right!important; max-width: 80px; min-width: 68px; height: 28px; display: block; }
|
||||
.nyaa-cat-1 { background-position: 0 0; }
|
||||
.nyaa-cat-2 { background-position: 0 -26px; }
|
||||
.nyaa-cat-4 { background-position: 0 -52px; }
|
||||
.nyaa-cat-3 { background-position: 0 -78px; }
|
||||
.nyaa-cat-6 { background-position: 0 -104px; }
|
||||
.nyaa-cat-5 { background-position: 0 -130px; }
|
||||
.nyaa-cat-8 { background-position: 0 -156px; }
|
||||
.nyaa-cat-7 { background-position: 0 -182px; }
|
||||
.nyaa-cat-9 { background-position: 0 -208px; }
|
||||
.nyaa-cat-10 { background-position: 0 -234px; }
|
||||
.nyaa-cat-11 { background-position: 0 -260px; }
|
||||
.nyaa-cat-12 { background-position: 0 -286px; }
|
||||
.nyaa-cat-13 { background-position: 0 -312px; }
|
||||
.nyaa-cat-14 { background-position: 0 -338px; }
|
||||
.nyaa-cat-15 { background-position: 0 -364px; }
|
||||
.nyaa-cat-16 { background-position: 0 -390px; }
|
||||
.nyaa-cat-18 { background-position: 0 -416px; }
|
||||
.sukebei-cat-11 { background-position: 0 -442px; }
|
||||
.sukebei-cat-12 { background-position: 0 -468px; }
|
||||
.sukebei-cat-13 { background-position: 0 -494px; }
|
||||
.sukebei-cat-14 { background-position: 0 -520px; }
|
||||
.sukebei-cat-15 { background-position: 0 -546px; }
|
||||
.sukebei-cat-21 { background-position: 0 -572px; }
|
||||
.nyaa-cat-1 { background-position: 0 -26px; }
|
||||
.nyaa-cat-2 { background-position: 0 -52px; }
|
||||
.nyaa-cat-4 { background-position: 0 -78px; }
|
||||
.nyaa-cat-3 { background-position: 0 -104px; }
|
||||
.nyaa-cat-6 { background-position: 0 -130px; }
|
||||
.nyaa-cat-5 { background-position: 0 -156px; }
|
||||
.nyaa-cat-8 { background-position: 0 -182px; }
|
||||
.nyaa-cat-7 { background-position: 0 -208px; }
|
||||
.nyaa-cat-9 { background-position: 0 -234px; }
|
||||
.nyaa-cat-10 { background-position: 0 -260px; }
|
||||
.nyaa-cat-11 { background-position: 0 -286px; }
|
||||
.nyaa-cat-12 { background-position: 0 -312px; }
|
||||
.nyaa-cat-13 { background-position: 0 -338px; }
|
||||
.nyaa-cat-14 { background-position: 0 -364px; }
|
||||
.nyaa-cat-15 { background-position: 0 -390px; }
|
||||
.nyaa-cat-16 { background-position: 0 -416px; }
|
||||
.nyaa-cat-18 { background-position: 0 -442px; }
|
||||
.sukebei-cat-11 { background-position: 0 -468px; }
|
||||
.sukebei-cat-12 { background-position: 0 -494px; }
|
||||
.sukebei-cat-13 { background-position: 0 -420px; }
|
||||
.sukebei-cat-14 { background-position: 0 -546px; }
|
||||
.sukebei-cat-15 { background-position: 0 -572px; }
|
||||
.sukebei-cat-21 { background-position: 0 -598px; }
|
||||
.sukebei-cat-22 { background-position: 0 -598px; }
|
||||
|
|
Fichier binaire non affiché.
Avant Largeur: | Hauteur: | Taille: 55 Kio Après Largeur: | Hauteur: | Taille: 57 Kio |
|
@ -1,23 +1,50 @@
|
|||
document.getElementsByClassName("form-torrent-name")[0].onkeyup = function(){
|
||||
document.getElementsByClassName("table-torrent-name")[0].innerText = document.getElementsByClassName("form-torrent-name")[0].value;
|
||||
var Sukebei = document.getElementById("IsUploadingToSukebei").value == "yes" ? 1 : 0;
|
||||
|
||||
|
||||
document.getElementsByClassName("torrent-preview-table")[0].style.display = "block";
|
||||
document.getElementsByClassName("table-torrent-date")[0].innerText = new Date(Date.now()).toLocaleString(document.getElementsByTagName("html")[0].getAttribute("lang"), { year: "numeric", month: "short", day: "numeric" });
|
||||
|
||||
for(var lang_index = 0; lang_index < document.getElementsByName("languages").length; lang_index++)
|
||||
document.getElementsByName("languages")[lang_index].addEventListener("change", UpdateTorrentLang);
|
||||
document.getElementsByClassName("form-torrent-category")[0].addEventListener("change", UpdatePreviewCategory);
|
||||
document.getElementsByClassName("form-torrent-name")[0].addEventListener("keyup", UpdatePreviewTorrentName);
|
||||
document.getElementsByClassName("form-torrent-remake")[0].onchange = function(){
|
||||
document.getElementsByName("torrent-info tr")[0].className = "torrent-info" + (UserTrusted ? " trusted" : "") + (document.getElementsByClassName("form-torrent-remake")[0].checked ? " remake" : "");
|
||||
};
|
||||
|
||||
function UpdatePreviewCategory(){
|
||||
document.getElementsByClassName("table-torrent-category")[0].className = "nyaa-cat table-torrent-category "+ Sukebei ? "sukebei" : "nyaa" + "-cat-" + Categorylist[Sukebei][document.getElementsByClassName("form-torrent-category")[0].selectedIndex];
|
||||
|
||||
function UpdatePreviewTorrentName(){
|
||||
document.getElementsByClassName("table-torrent-name")[0].innerText = document.getElementsByClassName("form-torrent-name")[0].value;
|
||||
}
|
||||
|
||||
function UpdatePreviewCategory(){
|
||||
document.getElementsByClassName("table-torrent-category")[0].className = "nyaa-cat table-torrent-category "+ (Sukebei ? "sukebei" : "nyaa") + "-cat-" + CategoryList[Sukebei][document.getElementsByClassName("form-torrent-category")[0].selectedIndex];
|
||||
}
|
||||
|
||||
function UpdateTorrentLang() {
|
||||
var lang_count,
|
||||
lang_value = "other",
|
||||
lang_title = "";
|
||||
|
||||
lang_count = 0;
|
||||
|
||||
for(var lang_index = 0, title_index = 0; lang_index < document.getElementsByName("languages").length; lang_index++) {
|
||||
if(document.getElementsByName("languages")[lang_index].checked) {
|
||||
lang_title= lang_title + document.getElementsByName("upload-lang-languagename")[lang_index].innerText + ",";
|
||||
if(++lang_count > 1){
|
||||
lang_value = "multiple";
|
||||
continue;
|
||||
}
|
||||
lang_value = document.getElementsByName("languages")[lang_index].value;
|
||||
}
|
||||
}
|
||||
var lang_cat = lang_value != "other" ? (lang_value > 1 ? "multiple" : lang_value) : "other";
|
||||
document.getElementsByClassName("table-torrent-flag")[0].className = "table-torrent-flag flag flag-" + lang_cat;
|
||||
document.getElementsByClassName("table-torrent-flag")[0].title = lang_title;
|
||||
}
|
||||
|
||||
document.getElementsByClassName("form-torrent-remake")[0].onchange = function(){
|
||||
document.getElementsByClassName("table-torrent-thead")[0].className = "torrent-info table-torrent-thead" + (UserTrusted ? " trusted" : "") + (document.getElementsByClassName("form-torrent-remake")[0].checked ? " remake" : "");
|
||||
};
|
||||
|
||||
document.getElementsByClassName("form-torrent-hidden")[0].onchange = function(){
|
||||
document.getElementsByClassName("table-torrent-thead")[0].className = "torrent-info table-torrent-thead" + (document.getElementsByClassName("form-torrent-remake")[0].checked ? " remake" : "");
|
||||
if(UserTrusted && !document.getElementsByClassName("form-torrent-hidden")[0].checked)
|
||||
document.getElementsByClassName("table-torrent-thead")[0].className = document.getElementsByClassName("table-torrent-thead")[0].className + " trusted";
|
||||
}; '
|
||||
|
||||
var CategoryList = [
|
||||
[5
|
||||
[0,
|
||||
12,
|
||||
5,
|
||||
13,
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
{{end}}
|
||||
<!-- Flags css -->
|
||||
<link rel="stylesheet" href="/css/flags/flags.min.css">
|
||||
<link rel="stylesheet" href="/css/flags/custom_flags.css">
|
||||
<!-- Search Box for Google -->
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebSite","url":"{{Config.WebAddress.Nyaa}}/","potentialAction":{"@type":"SearchAction","target":"{{Config.WebAddress.Nyaa}}/search?q={search_term_string}","query-input":"required name=search_term_string"} }</script>
|
||||
{{block additional_header()}}{{end}}
|
||||
|
@ -90,4 +89,4 @@
|
|||
<script type="text/javascript" charset="utf-8" src="/js/main.js?v={{ Config.Version }}{{ Config.Build }}" async></script>
|
||||
{{block footer_js()}}{{end}}
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{{ block flagList(languages=nil, selected="", inputname="languages")}}
|
||||
{{ block flagList(languages=nil, selected="", inputname="languages", id="lang")}}
|
||||
{{ if isset(languages) }}
|
||||
{{ range _, language := languages }}
|
||||
<span class="input-group">
|
||||
<input type="checkbox" name="{{inputname}}" class="form-language-checkbox" id="lang-{{ language.Code }}" value="{{language.Code}}"{{ range _, v := selected}}{{ if contains(v, language.Code) }} checked{{end}}{{end}}><label for="lang-{{ language.Code }}" class="flag flag-{{ language.Flag(false) }}" title="{{LanguageName(language, T)}}"></label>
|
||||
<span name="{{id}}-languagename">{{LanguageName(language, T)}}</span><input type="checkbox" name="{{inputname}}" class="form-language-checkbox" id="{{id}}-{{ language.Code }}" value="{{language.Code}}"{{ range _, v := selected}}{{ if contains(v, language.Code) }} checked{{end}}{{end}}><label for="{{id}}-{{ language.Code }}" class="flag flag-{{ language.Flag(false) }}" title="{{LanguageName(language, T)}}"></label>
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<div class="torrent-preview-table" style="display: none;"><center><h3 style="margin-bottom: 3px;">Preview your torrent</h3></center>
|
||||
<table style="border: 3px solid #dfdeeb;">
|
||||
<thead class="torrent-info table-torrent-thead{{ if User.IsTrusted() }} trusted{{end}}">
|
||||
<thead class="torrent-info table-torrent-thead">
|
||||
<tr>
|
||||
<th class="tr-cat">Category</th>
|
||||
<th class="tr-name">Name<span class="sort-arrows"><span class="sortarrowleft sortarrowdim">▼</span><span class="sortarrowdim">▲</span></span></th>
|
||||
|
@ -27,10 +27,10 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody id="torrentListResults">
|
||||
<tr class="torrent-info">
|
||||
<tr name="torrent-info tr" class="torrent-info{{ if User.IsTrusted() }} trusted{{end}}">
|
||||
<td class="tr-cat home-td">
|
||||
<div class="nyaa-cat {{ if Sukebei }}sukebei-cat-11{{else}}nyaa-cat-5{{end}}">
|
||||
<a class="category table-torrent-category"></a>
|
||||
<div class="nyaa-cat table-torrent-category">
|
||||
<a class="category"></a>
|
||||
<a><img src="/img/blank.gif" class="flag flag-other table-torrent-flag"></a>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -70,7 +70,7 @@
|
|||
|
||||
<h3>{{ T("torrent_language") }}</h3>
|
||||
<div name="language" class="form-input language">
|
||||
{{ yield flagList(languages=GetTorrentLanguages(), selected=Form.Languages) }}
|
||||
{{ yield flagList(languages=GetTorrentLanguages(), selected=Form.Languages, inputname="languages", id="upload-lang")}}
|
||||
</div>
|
||||
<p class="not-important">{{ T("language_not_mandatory") }}</p>
|
||||
{{ yield errors(name="language")}}
|
||||
|
@ -99,6 +99,7 @@
|
|||
<div style="width: 240px">
|
||||
{{yield captcha(captchaid=Form.CaptchaID)}}
|
||||
</div>
|
||||
<input type="hidden" id="IsUploadingToSukebei" value="{{ if Sukebei}}yes{{end}}">
|
||||
{{ yield errors(name="captchaID")}}
|
||||
<button type="submit" class="form-input up-btn">{{ T("upload")}}</button>
|
||||
</form>
|
||||
|
@ -106,32 +107,20 @@
|
|||
{{end}}
|
||||
{{ block footer_js()}}
|
||||
<script type="text/javascript" src="/js/kilo.js"></script>
|
||||
<script type="text/javascript">var Sukebei = {{Sukebei ? "1" : "0"}}; var UserTrusted = {{User.IsTrusted()}};
|
||||
document.getElementsByClassName("torrent-preview-table")[0].style.display = "block";
|
||||
document.getElementsByClassName("table-torrent-date")[0].innerText = new Date(Date.now()).toLocaleString(document.getElementsByTagName("html")[0].getAttribute("lang"), { year: "numeric", month: "short", day: "numeric" });
|
||||
document.getElementsByClassName("form-torrent-category")[0].addEventListener("change", UpdatePreviewCategory);
|
||||
|
||||
function UpdateTorrentLang() {
|
||||
var lang_count = 0,
|
||||
lang_value = "other";
|
||||
for(var lang_index = 0; lang_index < document.getElementsByClassName["form-language-checkbox"].length; lang_index++) {
|
||||
if(document.getElementsByClassName["form-language-checkbox"][lang_index].checked) {
|
||||
if(++lang_count > 1){
|
||||
lang_value = "multiple";
|
||||
break;
|
||||
}
|
||||
lang_value = document.getElementsByClassName["form-language-checkbox"][lang_index].value;
|
||||
}
|
||||
}
|
||||
var lang_cat = lang_value != "other" ? lang_value > 1 ? "multiple" : lang_value.substring(3, 5) : "other";
|
||||
document.getElementsByClassName["table-torrent-flag"][0].className = "table-torrent-flag flag flag-" + lang_cat;
|
||||
}
|
||||
|
||||
for(var lang_index = 0; lang_index < document.getElementsByClassName["form-language-checkbox"].length; lang_index++)
|
||||
document.getElementsByClassName["form-language-checkbox"][lang_index].addEventListener("change", UpdateTorrentLang);
|
||||
|
||||
UpdateTorrentLang();
|
||||
<script type="text/javascript">var UserTrusted = {{User.IsTrusted()}};
|
||||
UpdatePreviewTorrentName();
|
||||
UpdatePreviewCategory();
|
||||
UpdateTorrentLang();
|
||||
|
||||
{{ if User.ID > 0 }}
|
||||
document.getElementsByClassName("form-torrent-hidden")[0].onchange = function(){
|
||||
document.getElementsByName("torrent-info tr")[0].className = "";
|
||||
if(UserTrusted&& !document.getElementsByClassName("form-torrent-hidden")[0].checked)
|
||||
document.getElementsByName("torrent-info tr")[0].className = "trusted ";
|
||||
document.getElementsByName("torrent-info tr")[0].className = document.getElementsByName("torrent-info tr")[0].className + "torrent-info " + (document.getElementsByClassName("form-torrent-remake")[0].checked ? " remake" : "");
|
||||
};
|
||||
{{end }}
|
||||
|
||||
</script>
|
||||
<script type="text/javascript" src="/js/simplemde.min.js?v={{ Config.Version}}{{ Config.Build }}"></script>
|
||||
<script type="text/javascript">new SimpleMDE({ element: document.getElementById("desc"), spellChecker: false, showIcons: [ "strikethrough", "code", "table", "horizontal-rule" ] });</script>
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
{{ range i, t := UserProfile.Torrents }}
|
||||
{{ torrent := t.ToJSON() }}
|
||||
<tr class="torrent-info
|
||||
{{if torrent.Status == 2}}remake{{else if torrent.Status == 3}}trusted{{else if torrent.Status == 4}}aplus{{end}}">
|
||||
{{if torrent.Status == 2}}remake{{else if torrent.Status == 3}}trusted{{else if torrent.Status == 4}}aplus{{end}}
|
||||
{{if t.Hidden }} hidden{{end}}">
|
||||
<td class="tr-cat user-td">
|
||||
{{ if Sukebei }}
|
||||
<div class="nyaa-cat sukebei-cat-{{ torrent.Category }}{{ torrent.SubCategory}}">
|
||||
|
@ -35,7 +36,7 @@
|
|||
{{torrent.Name}}
|
||||
</a>
|
||||
</td>
|
||||
<td class="tr-links home-td">
|
||||
<td class="tr-links user-td">
|
||||
<a href="{{torrent.Magnet}}" title="{{ T("magnet_link") }}">
|
||||
<div class="icon-magnet"></div>
|
||||
</a>
|
||||
|
|
Référencer dans un nouveau ticket