Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/pat/inject/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,14 @@ const inject = {
VIDEO: "data-pat-inject-rebase-src",
},

_rebaseOptions: {
".pat-inject": "url",
".pat-calendar": "url",
".pat-date-picker": "i18n",
".pat-datetime-picker": "i18n",
".pat-collapsible": "load-content",
},

_rebaseHTML: function inject_rebaseHTML(base, html) {
if (html === "") {
// Special case, source is none
Expand Down Expand Up @@ -941,6 +949,18 @@ const inject = {
$this.attr(attrName, value);
}
});

const rebase_options = $page[0].querySelectorAll(
Object.keys(inject._rebaseOptions).join(",")
);
for (const el of rebase_options) {
for (const attr of Object.values(inject._rebaseOptions)) {
const opt = el.getAttribute(attr, null);
if (opt) {
}
}
}

// XXX: IE8 changes the order of attributes in html. The following
// lines move data-pat-inject-rebase-src to src.
$page.find("[data-pat-inject-rebase-src]").each(function () {
Expand Down