diff --git a/js/deps/jquery.js b/js/deps/jquery.js deleted file mode 100644 index 0832e03888..0000000000 --- a/js/deps/jquery.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "jquery"; diff --git a/js/deps/rollup.config.js b/js/deps/rollup.config.js index a03a8c7fef..936bd18da7 100644 --- a/js/deps/rollup.config.js +++ b/js/deps/rollup.config.js @@ -14,10 +14,6 @@ const template = { }; export default [ - { - input: "js/deps/jquery.js", - ...template - }, { input: "js/deps/pluralize.js", ...template diff --git a/src/core/jquery-enhanced.js b/src/core/jquery-enhanced.js deleted file mode 100644 index 8a5ce61456..0000000000 --- a/src/core/jquery-enhanced.js +++ /dev/null @@ -1,73 +0,0 @@ -// @ts-check -import { - addId, - getDfnTitles, - getLinkTargets, - getTextNodes, - renameElement, -} from "./utils.js"; -import $ from "../../js/deps/builds/jquery.js"; - -export const name = "core/jquery-enhanced"; - -window.$ = window.jQuery = $; - -// --- JQUERY EXTRAS ----------------------------------------------------------------------- -// Applies to any jQuery object containing elements, changes their name to the one give, and -// return a jQuery object containing the new elements -window.$.fn.renameElement = function (name) { - const arr = []; - // @ts-ignore - this.each(function () { - // @ts-ignore - const elem = this; - const newElem = renameElement(elem, name); - arr.push(newElem); - }); - return $(arr); -}; - -// For any element, returns an array of title strings that applies -// the algorithm used for determining the -// actual title of a element (but can apply to other as well). -// -// if args.isDefinition is true, then the element is a definition, not a -// reference to a definition. Any @title or @lt will be replaced with -// @data-lt to be consistent with Bikeshed / Shepherd. -// -// This method now *prefers* the data-lt attribute for the list of -// titles. That attribute is added by this method to dfn elements, so -// subsequent calls to this method will return the data-lt based list. -// -// This method will publish a warning if a title is used on a definition -// instead of an @lt (as per specprod mailing list discussion). -window.$.fn.getDfnTitles = function () { - return getDfnTitles(this[0]); -}; - -// For any element (usually ), returns an array of targets that -// element might refer to, of the form -// {for: 'interfacename', title: 'membername'}. -// -// For an element like: -//

Int3.member

-// we'll return: -// * {for: "int2", title: "int3.member"} -// * {for: "int3", title: "member"} -// * {for: "", title: "int3.member"} -window.$.fn.linkTargets = function () { - return getLinkTargets(this[0]); -}; - -// Applied to an element, sets an ID for it (and returns it), using a specific prefix -// if provided, and a specific text if given. -window.$.fn.makeID = function (pfx = "", txt = "", noLC = false) { - const elem = this[0]; - return addId(elem, pfx, txt, noLC); -}; - -// Returns all the descendant text nodes of an element. Note that those nodes aren't -// returned as a jQuery array since I'm not sure if that would make too much sense. -window.$.fn.allTextNodes = function (exclusions) { - return getTextNodes(this[0], exclusions); -}; diff --git a/tests/spec/core/utils-spec.js b/tests/spec/core/utils-spec.js index c93f345a5b..4c8d822021 100644 --- a/tests/spec/core/utils-spec.js +++ b/tests/spec/core/utils-spec.js @@ -428,7 +428,6 @@ describe("Core - Utils", () => { }); describe("DOM utils", () => { - // migrated from core/jquery-enhanced describe("getTextNodes", () => { it("finds all the text nodes", () => { const node = document.createElement("div");