Revert "Merge pull request #873 from hgiesel/otherjsdeps"

This reverts commit 62600051ae, reversing
changes made to 88553acb0d.

- Standard graphs render incorrectly on latest version - the wrong number
of days are shown, and the grid lines look wrong. Any version after 0.8.3
seems to suffer from this problem.
- Pie graphs and stack graphs don't render - they are provided in separate
files, and plot.js in previous Anki versions has them included in the one
file. To maintain compatibility with add-ons, we'd need to create a single
file as before, instead of importing multiple files.

If the above issues are fixed I'd be happy to merge this in again, but
as the old graphs are on the way out, it's probably not worth the effort.
This commit is contained in:
Damien Elmes 2020-12-30 14:13:52 +10:00
parent 32a5892327
commit 9e1eaacc06
7 changed files with 2286 additions and 2370 deletions

View file

@ -1,20 +1,13 @@
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 Normal file

File diff suppressed because one or more lines are too long

View file

@ -197,10 +197,6 @@ 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}"

View file

@ -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/jquery.flot.js"], js=["js/vendor/jquery.min.js", "js/vendor/plot.js"],
context=self, context=self,
) )
self.mw.progress.finish() self.mw.progress.finish()

View file

@ -1,29 +0,0 @@
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"),
},
)

View file

@ -61,11 +61,10 @@
"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"
}, },

File diff suppressed because it is too large Load diff