ckeditor_axe-1.0.x-dev/js/plugins/axe/plugin.min.js
js/plugins/axe/plugin.min.js
(() => {
"use strict";
function e(n) {
return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e;
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
})(n);
}
!function(n) {
n.plugins.add("axe", {
lang: "en",
onLoad: function() {
var t = {
context: void 0,
run: {}
};
t.run.rules = {
"aria-hidden-body": {
enabled: !1
},
bypass: {
enabled: !1
},
"document-title": {
enabled: !1
},
"frame-tested": {
enabled: !1
},
"frame-title-unique": {
enabled: !1
},
"frame-title": {
enabled: !1
},
"html-has-lang": {
enabled: !1
},
"html-lang-valid": {
enabled: !1
},
"html-xml-lang-mismatch": {
enabled: !1
},
"landmark-banner-is-top-level": {
enabled: !1
},
"landmark-complementary-is-top-level": {
enabled: !1
},
"landmark-contentinfo-is-top-level": {
enabled: !1
},
"landmark-main-is-top-level": {
enabled: !1
},
"landmark-no-duplicate-banner": {
enabled: !1
},
"landmark-no-duplicate-contentinfo": {
enabled: !1
},
"landmark-one-main": {
enabled: !1
},
"meta-viewport-large": {
enabled: !1
},
"meta-viewport": {
enabled: !1
},
"page-has-heading-one": {
enabled: !1
},
region: {
enabled: !1
},
"valid-lang": {
enabled: !1
}
}, t.callback = function(t, a, o) {
if (t) throw t;
if (console.log(a), void 0 === n.instances[o]) return console.error("Can't find editor instance."),
!1;
var i = n.instances[o];
if ("object" === e(a.violations)) {
var l = [], r = [];
a.violations.forEach((function(n, t) {
"object" === e(n.nodes) && (l[t] = {
title: n.help,
description: n.description
}, n.nodes.forEach((function(e) {
"undefined" !== e.target[0] && void 0 === r[e.target[0]] && (r[e.target[0]] = i.document.$.querySelector(e.target[0]),
console.dir(r[e.target[0]]));
})));
})), console.log(l), console.log(r);
}
return !0;
}, t.path = void 0, t.override = function(e) {
if (void 0 !== e) {
if (void 0 !== e.context && (this.context = e.context), void 0 !== e.run) {
var t = this.run.rules;
Object.keys(t).forEach((function(n) {
e.run[n] = t[n];
})), this.run = e.run;
}
"function" == typeof e.callback && (this.callback = e.callback), "string" == typeof e.path && (this.path = e.path);
}
if ("string" != typeof this.path) {
var a = document.querySelectorAll("script[src$='/axe.js'],script[src$='/axe.min.js']");
if (!a.length) return console.error("Can't fin axe.js or axe.min.js file. Please check if they were included."),
!1;
this.path = a[0].src;
}
return void 0 === this.callbackNumber && (this.callbackNumber = n.tools.addFunction(this.callback)),
!0;
}, this.axe = t;
},
init: function(e) {
var n = this, t = e.lang.axe;
n.axe.override(e.config.axe), e.on("instanceReady", (function() {
var e = [ n.axe.path, n.path + "frame.js" ], t = this;
e.forEach((function(e) {
t.document.getHead().append(t.document.createElement("script", {
attributes: {
src: e,
type: "text/javascript",
defer: !0
}
}));
}));
})), e.ui.addButton("axe", {
label: t.name,
command: "axe",
icon: n.path + "icons/axe.png",
toolbar: "others"
}), e.addCommand("axe", {
canUndo: !1,
exec: function(e) {
var t = {
command: "run",
editor: e.name,
arguments: {
context: n.axe.context,
options: n.axe.run,
callback: n.axe.callbackNumber
}
};
e.document.getWindow().$.postMessage(t);
}
});
}
});
}(CKEDITOR);
})();
//# sourceMappingURL=plugin.min.js.map