mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
Merge pull request #877 from hgiesel/jquery-ui
Update Jquery UI and include in Bazel deps
This commit is contained in:
commit
4e363505f0
7 changed files with 2370 additions and 2275 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:jquery-ui.bzl", "copy_jquery_ui")
|
||||||
|
|
||||||
copy_jquery(
|
copy_jquery(
|
||||||
name = "jquery",
|
name = "jquery",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
copy_jquery_ui(
|
||||||
|
name = "jquery-ui",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
files = [
|
files = [
|
||||||
"jquery",
|
"jquery",
|
||||||
|
"jquery-ui",
|
||||||
]
|
]
|
||||||
|
|
||||||
directories = [
|
directories = [
|
||||||
|
|
13
qt/aqt/data/web/js/vendor/jquery-ui.js
vendored
13
qt/aqt/data/web/js/vendor/jquery-ui.js
vendored
File diff suppressed because one or more lines are too long
|
@ -125,7 +125,7 @@ class DeckBrowser:
|
||||||
css=["css/deckbrowser.css"],
|
css=["css/deckbrowser.css"],
|
||||||
js=[
|
js=[
|
||||||
"js/vendor/jquery.min.js",
|
"js/vendor/jquery.min.js",
|
||||||
"js/vendor/jquery-ui.js",
|
"js/vendor/jquery-ui.min.js",
|
||||||
"js/deckbrowser.js",
|
"js/deckbrowser.js",
|
||||||
],
|
],
|
||||||
context=self,
|
context=self,
|
||||||
|
|
|
@ -197,6 +197,10 @@ def _redirectWebExports(path):
|
||||||
base = "jquery.min"
|
base = "jquery.min"
|
||||||
addprefix = "js/vendor/"
|
addprefix = "js/vendor/"
|
||||||
|
|
||||||
|
elif base == "jquery-ui":
|
||||||
|
base = "jquery-ui.min"
|
||||||
|
addprefix = "js/vendor/"
|
||||||
|
|
||||||
if addprefix:
|
if addprefix:
|
||||||
oldpath = path
|
oldpath = path
|
||||||
path = f"{targetPath}{addprefix}{base}{ext}"
|
path = f"{targetPath}{addprefix}{base}{ext}"
|
||||||
|
|
29
ts/jquery-ui.bzl
Normal file
29
ts/jquery-ui.bzl
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
load("//ts:copy.bzl", "copy_files")
|
||||||
|
|
||||||
|
"Rule to copy jquery-ui subset from node_modules to vendor folder."
|
||||||
|
|
||||||
|
_include = [
|
||||||
|
"jquery-ui.min.js",
|
||||||
|
]
|
||||||
|
|
||||||
|
_unwanted_prefix = "external/npm/node_modules/jquery-ui-dist/"
|
||||||
|
|
||||||
|
def _copy_jquery_ui_impl(ctx):
|
||||||
|
wanted = []
|
||||||
|
for f in ctx.attr.jquery_ui.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_jquery_ui = rule(
|
||||||
|
implementation = _copy_jquery_ui_impl,
|
||||||
|
attrs = {
|
||||||
|
"jquery_ui": attr.label(default = "@npm//jquery-ui-dist:jquery-ui-dist__files"),
|
||||||
|
},
|
||||||
|
)
|
|
@ -62,9 +62,10 @@
|
||||||
"d3-time": "^1.1.0",
|
"d3-time": "^1.1.0",
|
||||||
"d3-transition": "^1.3.2",
|
"d3-transition": "^1.3.2",
|
||||||
"intl-pluralrules": "^1.2.2",
|
"intl-pluralrules": "^1.2.2",
|
||||||
|
"jquery": "^3.5.1",
|
||||||
|
"jquery-ui-dist": "^1.12.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