Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Add commit from kipukun on simplemde

Cette révision appartient à :
akuma06 2017-07-13 13:57:19 +02:00
Parent bd71ca6d41
révision 5be870e21b
7 fichiers modifiés avec 35 ajouts et 48 suppressions

7
public/css/simplemde.min.css externe Fichier normal

Le diff du fichier est caché, car une ou plusieurs lignes sont trop longues

15
public/js/simplemde.min.js externe Fichier normal

Le diff du fichier est caché, car une ou plusieurs lignes sont trop longues

Voir le fichier

@ -1,34 +0,0 @@
// @source https://github.com/NyaaPantsu/nyaa/tree/dev/public/js
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
(function() {
var torrent = $("input[name=torrent]"),
magnet = $("input[name=magnet]"),
name = $("input[name=name]");
torrent.on("change", function() {
if (torrent.val() == "") {
enableField(magnet);
name.attr("required", "");
} else {
disableField(magnet);
// .torrent file will allow autofilling name
name.removeAttr("required", "");
}
});
magnet.on("change", function() {
if (magnet.val() == "")
enableField(torrent);
else
disableField(torrent);
});
function enableField(e) {
e.attr("required", "")
.removeAttr("disabled");
}
function disableField(e) {
e.attr("disabled", "")
.removeAttr("required");
}
})();
// @license-end

Voir le fichier

@ -49,9 +49,13 @@
<div class="form-group">
<label for="desc">{{ T("torrent_description")}}</label>
<p class="help-block">{{ T("description_markdown_notice")}}</p>
<textarea name="desc" class="form-input up-input" rows="10">{{Form.Description}}</textarea>
<textarea name="desc" id="desc" class="form-input up-input" rows="10">{{Form.Description}}</textarea>
</div>
<button type="submit" class="form-input up-input btn-green">{{ T("save_changes")}}</button>
</form>
</div>
{{end}}
{{ block footer_js()}}
<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>
{{end}}

Voir le fichier

@ -26,7 +26,7 @@
<link rel="alternate" type="application/rss+xml" title="Nyaa Pantsu - {{ yield rsstitle()}} EZTV RSS Feed" href="/feed/eztv??{{ yield rss_link() }}" />
<!-- do NOT move -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<link rel="stylesheet" href="/css/simplemde.min.css?v={{ Config.Version }}{{ Config.Build }}">
<!-- Base theme -->
<link rel="stylesheet" id="style" href="/css/main.css?v={{ Config.Version }}{{ Config.Build }}">
<!-- nyaacon, custom icon set -->

Voir le fichier

@ -54,7 +54,7 @@
<label class="input-label" for="desc">{{ T("torrent_description")}}</label>
{{ yield errors(name="desc")}}
<p class="help-block">{{ T("description_markdown_notice")}}</p>
<textarea style="height: 10rem;" name="desc" class="form-input up-input" rows="10">{{Form.Description}}</textarea>
<textarea style="height: 10rem;" id="desc" name="desc" class="form-input up-input" rows="10">{{Form.Description}}</textarea>
</div>
<button type="submit" class="form-input up-input">{{ T("save_changes")}}</button>
<br>
@ -62,12 +62,7 @@
</form>
</div>
{{end}}
{{block js_footer()}}
<script type="text/javascript" charset="utf-8" src="{{URL.Parse("/js/uploadPage.js")}}"></script>
<script type="text/javascript" charset="utf-8" src="https://cdnjs.cloudflare.com/ajax/libs/markdown.js/0.5.0/markdown.min.js"></script>
<script type="text/javascript" charset="utf-8" src="https://cdnjs.cloudflare.com/ajax/libs/to-markdown/3.0.4/to-markdown.js"></script>
<script type="text/javascript" charset="utf-8" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-markdown/2.10.0/js/bootstrap-markdown.js"></script>
<script>
$(".torrent-desc").markdown({resize: "both"})
</script>
{{end}}
{{ block footer_js()}}
<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>
{{end}}

Voir le fichier

@ -71,6 +71,6 @@
</div>
{{end}}
{{ block footer_js()}}
<script type="text/javascript" src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></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>
{{end}}
{{end}}