remove streamer.form.js

js-sound-v2
Thibault Duplessis 2020-09-13 12:05:05 +02:00
parent dd8c16df6e
commit 4f5151cc1b
3 changed files with 8 additions and 10 deletions

View File

@ -21,8 +21,7 @@ object edit extends Context.ToLang {
views.html.base.layout(
title = s"${s.user.titleUsername} ${lichessStreamer.txt()}",
moreCss = cssTag("streamer.form"),
moreJs = jsTag("streamer.form.js")
moreCss = cssTag("streamer.form")
) {
main(cls := "page-menu")(
bits.menu("edit", s.withoutStream.some),

View File

@ -1,6 +1,7 @@
package views.html.streamer
import controllers.routes
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
@ -11,8 +12,12 @@ object picture {
def apply(s: lila.streamer.Streamer.WithUser, error: Option[String] = None)(implicit ctx: Context) =
views.html.base.layout(
title = xStreamerPicture.txt(),
moreJs = jsTag("streamer.form.js"),
title = xStreamerPicture.txt(s.user.username),
moreJs = embedJsUnsafeLoadThen("""
$('.streamer-picture form.upload input[type=file]').on('change', function() {
$('.picture_wrap').html(lichess.spinnerHtml);
$(this).parents('form')[0].submit();
})"""),
moreCss = cssTag("streamer.form")
) {
main(cls := "streamer-picture small-page box")(

View File

@ -1,6 +0,0 @@
$(function() {
$('.streamer_picture form.upload input[type=file]').on('change', function() {
$('.picture_wrap').html(lichess.spinnerHtml);
$(this).parents('form').trigger('submit');
});
});