Open
Description
Great little plugin! Worked like a charm for me.
Quick note, I'm not sure the purpose of line 66:
if (0 === (e = this.$modal.find("#redactor-link-styles")).length)
Is that line checking for a different installed plugin?
Also, your label and select classes should be updated to: modal-link-text
Otherwise, I have modified your init function to include injecting CSS:
// inject CSS, if classes set
if(this.opts.linkClasses.length) {
const style = document.createElement('style');
var classes = [];
this.opts.linkClasses.forEach( function(e) {
if(e.style !== undefined) {
classes.push('.redactor-styles a.' + e.class + '{' + e.style + '}');
}
});
// combine and remove comma in output
style.textContent = classes.join("");
document.head.append(style);
}
Which looks for an extra JSON element, such as:
{ "label": "Button (regular)", "class": "button", "style": "color: blue;" }
Of course, the main style on the frontend is still needed (without the .redactor-styles
portion).
Metadata
Metadata
Assignees
Labels
No labels