mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
Merge pull request #873 from hgiesel/otherjsdeps
Update plotting library to 4.2.1 and include in Bazel build
This commit is contained in:
commit
62600051ae
7 changed files with 2370 additions and 2286 deletions
7
qt/aqt/data/web/js/vendor/BUILD.bazel
vendored
7
qt/aqt/data/web/js/vendor/BUILD.bazel
vendored
|
@ -1,13 +1,20 @@
|
||||||
load("//ts:jquery.bzl", "copy_jquery")
|
load("//ts:jquery.bzl", "copy_jquery")
|
||||||
|
load("//ts:flot.bzl", "copy_flot")
|
||||||
|
|
||||||
copy_jquery(
|
copy_jquery(
|
||||||
name = "jquery",
|
name = "jquery",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
copy_flot(
|
||||||
|
name = "flot",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
files = [
|
files = [
|
||||||
"jquery",
|
"jquery",
|
||||||
|
"flot",
|
||||||
]
|
]
|
||||||
|
|
||||||
directories = [
|
directories = [
|
||||||
|
|
24
qt/aqt/data/web/js/vendor/plot.js
vendored
24
qt/aqt/data/web/js/vendor/plot.js
vendored
File diff suppressed because one or more lines are too long
|
@ -197,6 +197,10 @@ def _redirectWebExports(path):
|
||||||
base = "jquery.min"
|
base = "jquery.min"
|
||||||
addprefix = "js/vendor/"
|
addprefix = "js/vendor/"
|
||||||
|
|
||||||
|
elif base == "plot":
|
||||||
|
base = "jquery.flot"
|
||||||
|
addprefix = "js/vendor/"
|
||||||
|
|
||||||
if addprefix:
|
if addprefix:
|
||||||
oldpath = path
|
oldpath = path
|
||||||
path = f"{targetPath}{addprefix}{base}{ext}"
|
path = f"{targetPath}{addprefix}{base}{ext}"
|
||||||
|
|
|
@ -177,7 +177,7 @@ class DeckStats(QDialog):
|
||||||
self.form.web.title = "deck stats"
|
self.form.web.title = "deck stats"
|
||||||
self.form.web.stdHtml(
|
self.form.web.stdHtml(
|
||||||
"<html><body>" + self.report + "</body></html>",
|
"<html><body>" + self.report + "</body></html>",
|
||||||
js=["js/vendor/jquery.min.js", "js/vendor/plot.js"],
|
js=["js/vendor/jquery.min.js", "js/vendor/jquery.flot.js"],
|
||||||
context=self,
|
context=self,
|
||||||
)
|
)
|
||||||
self.mw.progress.finish()
|
self.mw.progress.finish()
|
||||||
|
|
29
ts/flot.bzl
Normal file
29
ts/flot.bzl
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
load("//ts:copy.bzl", "copy_files")
|
||||||
|
|
||||||
|
"Rule to copy flot subset from node_modules to vendor folder."
|
||||||
|
|
||||||
|
_include = [
|
||||||
|
"dist/es5/jquery.flot.js",
|
||||||
|
]
|
||||||
|
|
||||||
|
_unwanted_prefix = "external/npm/node_modules/flot/dist/es5/"
|
||||||
|
|
||||||
|
def _copy_flot_impl(ctx):
|
||||||
|
wanted = []
|
||||||
|
for f in ctx.attr.flot.files.to_list():
|
||||||
|
path = f.path
|
||||||
|
want = True
|
||||||
|
|
||||||
|
for substr in _include:
|
||||||
|
if substr in path:
|
||||||
|
output = path.replace(_unwanted_prefix, "")
|
||||||
|
wanted.append((f, output))
|
||||||
|
|
||||||
|
return copy_files(ctx, wanted)
|
||||||
|
|
||||||
|
copy_flot = rule(
|
||||||
|
implementation = _copy_flot_impl,
|
||||||
|
attrs = {
|
||||||
|
"flot": attr.label(default = "@npm//flot:flot__files"),
|
||||||
|
},
|
||||||
|
)
|
|
@ -61,10 +61,11 @@
|
||||||
"d3-shape": "^1.3.7",
|
"d3-shape": "^1.3.7",
|
||||||
"d3-time": "^1.1.0",
|
"d3-time": "^1.1.0",
|
||||||
"d3-transition": "^1.3.2",
|
"d3-transition": "^1.3.2",
|
||||||
|
"flot": "^4.2.1",
|
||||||
"intl-pluralrules": "^1.2.2",
|
"intl-pluralrules": "^1.2.2",
|
||||||
|
"jquery": "^3.5.1",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8",
|
||||||
"lodash.throttle": "^4.1.1",
|
"lodash.throttle": "^4.1.1",
|
||||||
"jquery": "^3.5.1",
|
|
||||||
"mathjax": "^3.1.2",
|
"mathjax": "^3.1.2",
|
||||||
"protobufjs": "^6.10.1"
|
"protobufjs": "^6.10.1"
|
||||||
},
|
},
|
||||||
|
|
4587
ts/yarn.lock
4587
ts/yarn.lock
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue