upgrade moment.js

pull/133/head
Thibault Duplessis 2014-11-19 23:28:49 +01:00
parent 35d73a94c9
commit 4ccfb6320e
5 changed files with 16 additions and 21 deletions

3
.gitmodules vendored
View File

@ -22,3 +22,6 @@
[submodule "ui/chessli"]
path = ui/chessli
url = https://github.com/ornicar/chess.js
[submodule "public/vendor/moment"]
path = public/vendor/moment
url = https://github.com/moment/moment

View File

@ -4,7 +4,7 @@ package templating
import controllers.routes
import play.twirl.api.Html
trait AssetHelper {
trait AssetHelper { self: I18nHelper =>
val assetVersion = lila.api.Env.current.Net.AssetVersion
@ -51,9 +51,18 @@ trait AssetHelper {
local = staticUrl("vendor/highcharts4/highstock.js"))
val momentjsTag = cdnOrLocal(
cdn = "http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js",
cdn = "http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js",
test = "window.moment",
local = staticUrl("vendor/momentjs.min.js"))
local = staticUrl("vendor/moment/min/moment.min.js"))
def momentLangTag(implicit ctx: lila.api.Context) = (lang(ctx).language match {
case "en" => none
case "pt" => "pt-br".some
case "zh" => "zh-cn".some
case l => l.some
}).fold(Html("")) { l =>
jsAt(s"vendor/moment/locale/$l.js", static = true)
}
val powertipTag = cdnOrLocal(
cdn = "http://cdnjs.cloudflare.com/ajax/libs/jquery-powertip/1.2.0/jquery.powertip.min.js",

View File

@ -63,15 +63,4 @@ trait DateHelper { self: I18nHelper =>
def momentFromNow(date: DateTime) = Html {
s"""<time class="moment-from-now" datetime="${isoFormatter print date}"></time>"""
}
def momentLangTag(implicit ctx: Context) = Html {
(lang(ctx).language match {
case "en" => none
case "pt" => "pt-br".some
case "zh" => "zh-cn".some
case l => l.some
}) ?? { l =>
s"""<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.6.0/lang/$l.js"></script>"""
}
}
}

1
public/vendor/moment vendored 160000

@ -0,0 +1 @@
Subproject commit 2f9b330eb35a38184fd7239749c7f0feef6c5146

File diff suppressed because one or more lines are too long